Skip to content

Commit c52598e

Browse files
committed
Merge remote-tracking branch 'origin/master'
# Conflicts: # public
2 parents 6dc555e + 1d2e32f commit c52598e

File tree

89 files changed

+33866
-604
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+33866
-604
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
# GraphQL Kickstart Documentation
1+
# [GraphQL Kickstart Documentation](https://www.graphql-java-kickstart.com/tools/)
22
[![Build Status](https://travis-ci.org/graphql-java-kickstart/documentation.svg?branch=master)](https://travis-ci.org/graphql-java-kickstart/documentation)
33

4-
Documentation for GraphQL Kickstart projects.
4+
## Running the site locally
5+
1. Clone this repository
6+
2. Execute `brew install hugo`
7+
3. Execute `hugo server` in the root of the project

content/tools/_index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ GraphQL Java Tools aims for seamless integration with Java, but works for any JV
2323
A few libraries exist to ease the boilerplate pain, including [GraphQL-Java's built-in schema-first wiring](http://graphql-java.readthedocs.io/en/latest/schema.html), but none (so far) do type and datafetcher discovery.
2424
* **Stateful Data Fetchers**: If you're using an IOC container (like Spring), it's hard to wire up datafetchers that make use of beans you've already defined without a bunch of fragile configuration. GraphQL Java Tools allows you to register "Resolvers" for any type that can bring state along and use that to resolve fields.
2525
* **Generated DataFetchers**: GraphQL Java Tools automatically creates data fetchers for your fields that call the appropriate method on your java class. This means all you have to do to create a new field is add the field definition to your schema and add a corresponding method on your class.
26-
* **Type->Class Discovery**: GraphQL Java Tools starts from your root objects (Query, Mutation) and, as it's generating data fetchers for you, starts to learn about the classes you use for a certain GraphQL type.
27-
* **Class Validation**: Since there aren't any compile-time checks of the type->class relationship, GraphQL Java Tools will warn you if you provide classes/types that you don't need to, as well as erroring if you use the wrong Java class for a certain GraphQL type when it builds the schema.
26+
* **TypeClass Discovery**: GraphQL Java Tools starts from your root objects (Query, Mutation) and, as it's generating data fetchers for you, starts to learn about the classes you use for a certain GraphQL type.
27+
* **Class Validation**: Since there aren't any compile-time checks of the typeclass relationship, GraphQL Java Tools will warn you if you provide classes/types that you don't need to, as well as throwing errors if you use the wrong Java class for a certain GraphQL type when it builds the schema.
2828
* **Unit Testing**: Since your GraphQL schema is independent of your data model, this makes your classes simple and extremely testable.

content/tools/getting-started/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Add the `graphql-java-tools` dependency:
4949

5050
## Using the latest development build
5151

52-
Snapshot versions of the current `master` branch are availble on JFrog. Check the next snapshot version on
52+
Snapshot versions of the current `master` branch are available on JFrog. Check the next snapshot version on
5353
[Github](https://github.com/graphql-java-kickstart/graphql-java-tools/blob/master/gradle.properties)
5454

5555
### Build with Gradle

content/tools/schema-definition/index.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ type Author {
5555
```
5656

5757
GraphQL Java Tools will expect to be given three classes that map to the GraphQL types: `Query`, `Book`, and `Author`.
58-
The Data classes for Book and Author are simple:
58+
The Data classes for `Book` and `Author` are simple:
5959

6060
```java
6161
class Book {
@@ -81,10 +81,10 @@ class Author {
8181
}
8282
```
8383

84-
But what about the complex fields on `Query` and `Book`?
84+
What about the complex fields on `Query` and `Book`?
8585
These are handled by "Resolvers". Resolvers are object instances that reference the "Data Class" they resolve fields for.
8686

87-
The BookResolver might look something like this:
87+
The `BookResolver` might look something like this:
8888
```java
8989
class BookResolver implements GraphQLResolver<Book> /* This class is a resolver for the Book "Data Class" */ {
9090

@@ -100,13 +100,13 @@ class BookResolver implements GraphQLResolver<Book> /* This class is a resolver
100100
}
101101
```
102102

103-
When given a BookResolver instance, GraphQL Java Tools first attempts to map fields to methods on the resolver before mapping them to fields or methods on the data class.
103+
When given a `BookResolver` instance, GraphQL Java Tools first attempts to map fields to methods on the resolver before mapping them to fields or methods on the data class.
104104
If there is a matching method on the resolver, the data class instance is passed as the first argument to the resolver function. This does not apply to root resolvers, since those don't have a data class to resolve for.
105-
An optional argument can be defined to inject the `DataFetchingEnvironment`, and must be the last argument.
105+
An optional parameter can be defined to inject the `DataFetchingEnvironment`, and must be the last argument.
106106

107107
### Root Resolvers
108108

109-
Since the Query/Mutation/Subscription objects are root GraphQL objects, they doesn't have an associated data class. In those cases, any resolvers implementing `GraphQLQueryResolver`, `GraphQLMutationResolver`, or `GraphQLSubscriptionResolver` will be searched for methods that map to fields in their respective root types. Root resolver methods can be spread between multiple resolvers, but a simple example is below:
109+
Since the Query/Mutation/Subscription objects are root GraphQL objects, they don't have an associated data class. In those cases, any resolvers implementing `GraphQLQueryResolver`, `GraphQLMutationResolver`, or `GraphQLSubscriptionResolver` will be searched for methods that map to fields in their respective root types. Root resolver methods can be spread between multiple resolvers, but a simple example is below:
110110
```java
111111
class Query implements GraphQLQueryResolver {
112112

@@ -152,9 +152,7 @@ Last of all, if the data class implements`java.util.Map` then:
152152
1. `method get(name)`
153153

154154

155-
*Note:* All reflection discovery is done on startup, and runtime reflection method calls use [reflectasm](https://github.com/EsotericSoftware/reflectasm), which increases performance and unifies stacktraces. No more `InvocationTargetException`!
156-
157-
*Note:* `java.util.Optional` can be used for nullable field arguments and nullable return values, and the schema parser will verify that it's not used with non-null field arguments and return values.
155+
<!--*Note:* `java.util.Optional` can be used for nullable field arguments and nullable return values, and the schema parser will verify that it's not used with non-null field arguments and return values.-->
158156

159157
*Note:* Methods on `java.lang.Object` are excluded from method matching, for example a field named `class` will require a method named `getFieldClass` defined.
160158

@@ -217,7 +215,7 @@ SchemaParser.newParser()
217215

218216
## Making the graphql-java Schema Instance
219217

220-
After you've passed all relavant schema files/class to the parser, call `.build()` and `.makeExecutableSchema()` to get a graphql-java `GraphQLSchema`:
218+
After you've passed all relevant schema files/class to the parser, call `.build()` and `.makeExecutableSchema()` to get a graphql-java `GraphQLSchema`:
221219

222220
```java
223221
SchemaParser.newParser()
@@ -226,7 +224,7 @@ SchemaParser.newParser()
226224
.makeExecutableSchema()
227225
```
228226

229-
If you want to build the `GraphQLSchema` yourself, you can get all of the parsed objects with `parseSchemaObjects()`:
227+
If you want to build the `GraphQLSchema` yourself, you can get all the parsed objects with `parseSchemaObjects()`:
230228

231229
```java
232230
SchemaParser.newParser()

public

Submodule public deleted from f6a6c68

public/CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
www.graphql-java-kickstart.com
Lines changed: 20 additions & 0 deletions
Loading
Lines changed: 18 additions & 0 deletions
Loading
Lines changed: 38 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)