Skip to content

Commit 02fa718

Browse files
andimarek-atlassianandimarek
authored andcommitted
wip
1 parent 335df2f commit 02fa718

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

content/blog/getting-started-with-spring-boot.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,21 @@ The `typeRegistry` defined above is just types: it describes how the schema look
182182

183183
### DataFetcher
184184

185-
Probably the most important concept of a GraphQL Java server is a `DataFetcher`:
185+
Probably the most important concept for a GraphQL Java server is a `DataFetcher`:
186186
A `DataFetcher` fetches the Data for one field while the query is executed.
187187

188188
While GraphQL Java is executing a query it calls the appropriate `DataFetcher` for each field it encounters in query.
189+
A `DataFetcher` is a Interface with a single method, taking a single argument of type `DataFetcherEnvironment`.
189190

191+
For our first iteration we are doing the simplest possible thing that works: we are fetching the books we wanna display from in-memory.
190192

193+
Our code looks like this:
194+
195+
{{< highlight java "linenos=table" >}}
196+
....
197+
{{< / highlight >}}
198+
199+
200+
Important: **Every** field from the schema has a `DataFetcher` associated with. Most of them have a actually the defaultData
191201

192202

0 commit comments

Comments
 (0)