use of graphql.kickstart.tools.SchemaParserBuilder in project micronaut-graphql by micronaut-projects.
the class GraphQLFactory method graphQL.
@Bean
@Singleton
public GraphQL graphQL(ToDoQueryResolver toDoQueryResolver, ToDoMutationResolver toDoMutationResolver, ToDoResolver toDoResolver) {
// Parse the schema.
SchemaParserBuilder builder = SchemaParser.newParser().file("schema.graphqls").resolvers(toDoQueryResolver, toDoMutationResolver, toDoResolver);
// Create the executable schema.
GraphQLSchema graphQLSchema = builder.build().makeExecutableSchema();
// Return the GraphQL bean.
return GraphQL.newGraphQL(graphQLSchema).build();
}
Aggregations