Skip to content

Code generation and field data fetchers #18

Answered by paulbakker
victorlevasseur asked this question in Q&A
Discussion options

You must be logged in to vote

There are multiple relevant answers to this question, let me try to explain the different options.

Yes, by default, the generated POJOs contain all fields of the types in the schema. Note that the structure of the POJO is unrelated to how you structure your data fetchers. Let's look at an example:

type Query {
    shows: [Show]
}

type Show {
   title: String
   actors: [Actor]
}

type Actor {
   name: String
}

This would generate two POJOs: Show and Actor.
The generated Show class has two fields, title and actors.

Independent of how the Show class looks, you can structure your data fetchers in different ways.
For example you could have a single data fetcher which fully constructs a show…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@victorlevasseur
Comment options

Answer selected by victorlevasseur
Comment options

You must be logged in to vote
2 replies
@paulbakker
Comment options

@hikuley
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants