-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migration of GraphQL todo example app to guide #822
Conversation
@timyates To give you a head start, I created the guide skeleton:
Next steps:
Let me know if you have any doubts. |
@sdelamo I think this is ready for you to take a look over, before I extend it to kotlin and groovy |
|
||
* Some time on your hands | ||
* A decent text editor or IDE | ||
* JDK 11 or greater installed with `JAVA_HOME` configured appropriately |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why JDK 11? Either way you should use common-requirements.adoc or common-requirements-jdk11.adoc here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw the generated build in build/code/micronaut-graphql-todo/micronaut-graphql-todo-gradle-java/build.gradle
contained
java {
sourceCompatibility = JavaVersion.toVersion("11")
targetCompatibility = JavaVersion.toVersion("11")
}
I will investigate, but I've removed this 11 requirement from the docs for now
---- | ||
mn create-app example.micronaut.micronautguide \ | ||
--features=@features@ \ | ||
--jdk=11 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these 3 should be on one line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced this with create-app-features.adoc
guides/micronaut-graphql-todo/src/main/resources/db/migration/V1__schema.sql
Show resolved
Hide resolved
|
||
=== Entities | ||
|
||
We can then create an Entity class to hold an Author: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hold -> represent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also remove "We can" (most instances throughout)
guides/micronaut-graphql-todo/java/src/main/java/example/micronaut/Author.java
Outdated
Show resolved
Hide resolved
guides/micronaut-graphql-todo/java/src/main/java/example/micronaut/ToDo.java
Outdated
Show resolved
Hide resolved
guides/micronaut-graphql-todo/java/src/main/java/example/micronaut/Author.java
Outdated
Show resolved
Hide resolved
guides/micronaut-graphql-todo/java/src/main/java/example/micronaut/AuthorRepository.java
Outdated
Show resolved
Hide resolved
import java.io.InputStream; | ||
import java.io.InputStreamReader; | ||
|
||
@Factory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should have callouts for @Factory
and @Bean
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed @Bean
as I believe this is covered by @Singleton
... But I added an annotation for @Factory
and @Singleton
guides/micronaut-graphql-todo/java/src/main/java/example/micronaut/GraphQLFactory.java
Outdated
Show resolved
Hide resolved
guides/micronaut-graphql-todo/java/src/main/java/example/micronaut/GraphQLFactory.java
Outdated
Show resolved
Hide resolved
guides/micronaut-graphql-todo/java/src/test/java/example/micronaut/GraphQLControllerTest.java
Outdated
Show resolved
Hide resolved
I started postgresql in Docker and started the generated app but it fails with error "The server requested password-based authentication, but no password was provided." |
@timyates Please, address @burtbeckwith feedback. |
Did you set the environment variables 🤔 Do we need to make this stand out more in the guide? |
I have removed all instances of Thanks @burtbeckwith 👍 |
* Migration of GraphQL todo example app to guide See: micronaut-projects/micronaut-graphql#242 Relates to: micronaut-projects/micronaut-graphql#241 * remove tags and add languages to metadata.json * Add todo graphql guide and add tests * Switch to postgres and Flyway * Update screenshot to new ID format * More asciidoc work * Polish * Further cleanups... * Address feedback * use common flyway * use common test * use callouts Co-authored-by: Tim Yates <tim.yates@gmail.com>
* Migration of GraphQL todo example app to guide See: micronaut-projects/micronaut-graphql#242 Relates to: micronaut-projects/micronaut-graphql#241 * remove tags and add languages to metadata.json * Add todo graphql guide and add tests * Switch to postgres and Flyway * Update screenshot to new ID format * More asciidoc work * Polish * Further cleanups... * Address feedback * use common flyway * use common test * use callouts Co-authored-by: Tim Yates <tim.yates@gmail.com>
See: micronaut-projects/micronaut-graphql#242
Relates to: micronaut-projects/micronaut-graphql#241
To generate the sample projects and the HTML
./gradlew -x micronautGraphqlTodoRunTestScript micronautGraphqlTodoBuild
You can open the HTML at:
open build/dist/index.html
To run the test for every generated project: