Skip to content

Commit 3814eab

Browse files
authored
Update HelloWorld GraphQL Java example and add tutorial links (graphql#1383)
1 parent d68214c commit 3814eab

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/content/code/language-support/java-kotlin-android/server/graphql-java.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ url: https://github.com/graphql-java/graphql-java
55
github: graphql-java/graphql-java
66
---
77

8+
See the [Getting Started tutorial](https://www.graphql-java.com/tutorials/getting-started-with-spring-boot) on the GraphQL Java website.
9+
810
Code that executes a hello world GraphQL query with `graphql-java`:
911

1012
```java
@@ -22,12 +24,12 @@ import static graphql.schema.idl.RuntimeWiring.newRuntimeWiring;
2224
public class HelloWorld {
2325

2426
public static void main(String[] args) {
25-
String schema = "type Query{hello: String} schema{query: Query}";
27+
String schema = "type Query{hello: String}";
2628

2729
SchemaParser schemaParser = new SchemaParser();
2830
TypeDefinitionRegistry typeDefinitionRegistry = schemaParser.parse(schema);
2931

30-
RuntimeWiring runtimeWiring = new RuntimeWiring()
32+
RuntimeWiring runtimeWiring = newRuntimeWiring()
3133
.type("Query", builder -> builder.dataFetcher("hello", new StaticDataFetcher("world")))
3234
.build();
3335

@@ -43,5 +45,4 @@ public class HelloWorld {
4345
}
4446
```
4547

46-
See [the graphql-java docs](https://github.com/graphql-java/graphql-java) for more information on setup.
47-
48+
See [the graphql-java docs](https://www.graphql-java.com/documentation/master/getting-started) for further information.

src/content/code/language-support/java-kotlin-android/server/spring-graphql.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ url: https://spring.io/projects/spring-graphql
55
github: spring-projects/spring-graphql
66
---
77
Spring for GraphQL provides support for Spring applications built on
8-
[GraphQL Java](https://www.graphql-java.com/).
8+
[GraphQL Java](https://www.graphql-java.com/). See the official [Spring guide](https://spring.io/guides/gs/graphql-server/) for how to build a GraphQL service in 15 minutes.
99

1010
* It is a joint collaboration between the GraphQL Java team and Spring engineering.
1111
* Our shared philosophy is to provide as little opinion as we can while focusing on comprehensive support for a wide range of use cases.

0 commit comments

Comments
 (0)