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.

  • Class
    Description
    Resolves one field: what the build generates for each @QueryMapping, @MutationMapping, @SubscriptionMapping and @SchemaMapping method, and what a program registers by hand with GraphQL.Builder.fetcher(String, String, DataFetcher).
    What a DataFetcher is given: the parent value, the field's arguments and the request's context.
    A GraphQL engine: a GraphQLSchema with the resolvers of its fields, executing queries, mutations and subscriptions.
    Resolves one field for many sources in one call -- what @BatchMapping binds, 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 a GraphQL.
    Receives what a subscription produces.
    Serves a GraphQL engine over HTTP, as the GraphQL over HTTP specification describes, and its subscriptions over WebSocket with the graphql-transport-ws protocol -- what Spring for GraphQL serves, under the same settings:
    An error a resolver throws to put a message of its own in the response's errors, as Spring for GraphQL's GraphQLError does.
    The coercion of a custom scalar, such as scalar Date: Spring for GraphQL's Coercing.
    A schema read from GraphQL schema definition language, the .graphqls files Spring for GraphQL reads from src/main/resources/graphql.
    The events of a subscription field: what a @SubscriptionMapping method returns, in place of Spring for GraphQL's Flux.
    Where a stream sends what it produces.
    Names the object type of a value returned for an interface or union field.