Package com.codename1.backend.graphql
package com.codename1.backend.graphql
GraphQL for the backend, in the shape of Spring for GraphQL: a schema
written in .graphqls files under src/main/resources/graphql, resolved by
@QueryMapping, @MutationMapping, @SubscriptionMapping and
@SchemaMapping methods of @Controller beans, and served at /graphql.
The build reads the schema, matches every resolver against it -- a method
naming a field the schema lacks is a build error -- and generates the
wiring, so nothing is scanned or reflected at run time.
GraphQL is the engine and
GraphQLEndpoint serves it over HTTP and,
for subscriptions, over WebSocket with the graphql-transport-ws protocol
the client's GraphQLSubscription speaks.
-
ClassDescriptionResolves one field: what the build generates for each
@QueryMapping,@MutationMapping,@SubscriptionMappingand@SchemaMappingmethod, and what a program registers by hand withGraphQL.Builder.fetcher(String, String, DataFetcher).What aDataFetcheris given: the parent value, the field's arguments and the request's context.A GraphQL engine: aGraphQLSchemawith the resolvers of its fields, executing queries, mutations and subscriptions.Resolves one field for many sources in one call -- what@BatchMappingbinds, and Spring's answer to the N+1 problem: the field of every object in a list is loaded together, before any of them is completed.Builds aGraphQL.Receives what a subscription produces.Serves aGraphQLengine over HTTP, as the GraphQL over HTTP specification describes, and its subscriptions over WebSocket with thegraphql-transport-wsprotocol -- what Spring for GraphQL serves, under the same settings:An error a resolver throws to put a message of its own in the response'serrors, as Spring for GraphQL'sGraphQLErrordoes.The coercion of a custom scalar, such asscalar Date: Spring for GraphQL'sCoercing.A schema read from GraphQL schema definition language, the.graphqlsfiles Spring for GraphQL reads fromsrc/main/resources/graphql.The events of a subscription field: what a@SubscriptionMappingmethod returns, in place of Spring for GraphQL'sFlux.Where a stream sends what it produces.Names the object type of a value returned for an interface or union field.