Created
April 29, 2020 09:21
-
-
Save dmi3coder/75d5814206629fe46319e369edd00864 to your computer and use it in GitHub Desktop.
Example of createGraphQL method in Quarkus GraphQL example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private GraphQL createGraphQL() throws Exception { | |
TypeDefinitionRegistry teamsSchema = getTeamSchema(); | |
RuntimeWiring runtimeWiring = RuntimeWiring.newRuntimeWiring() | |
.type("Query", | |
builder -> builder.dataFetcher("allTeams", new VertxDataFetcher<>(this::getAllTeams)) | |
).build(); | |
SchemaGenerator schemaGenerator = new SchemaGenerator(); | |
GraphQLSchema graphQLSchema = schemaGenerator.makeExecutableSchema(teamsSchema, runtimeWiring); | |
return GraphQL.newGraphQL(graphQLSchema).build(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment