Skip to content

Instantly share code, notes, and snippets.

@nwillc
Created November 20, 2017 04:33
Show Gist options
  • Save nwillc/2a1b3a3cea5e6fdfa5fb68c8f32e9de0 to your computer and use it in GitHub Desktop.
Save nwillc/2a1b3a3cea5e6fdfa5fb68c8f32e9de0 to your computer and use it in GitHub Desktop.
Runtime Wiring attaching a fetcher to a query
RuntimeWiring.newRuntimeWiring()
.type("QueryType", wiring -> wiring
.dataFetcher("company", new CompanyQuery(companies))
.dataFetcher("companies", new CompaniesQuery(companies))
)
.type("MutationType", wiring -> wiring
.dataFetcher("company", new CompanyMutation(companies))
.dataFetcher("companyDelete", new CompanyDelete(companies))
)
.build();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment