Interface GQLContextFactory<Context extends GQLContext>

  • Type Parameters:
    Context - The context implementation type.
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface GQLContextFactory<Context extends GQLContext>
    Create a context instance to be used in the graphql servlet.
    • Field Detail

      • DEFAULT_INSTANCE

        static final GQLContextFactory DEFAULT_INSTANCE
        Default instance to be used when no special context is needed. The default instance makes the HTTP request and the GQL operation available on processor instantiation.
    • Method Detail

      • createContext

        Context createContext​(@Nonnull
                              javax.servlet.http.HttpServletRequest request,
                              @Nonnull
                              GQLOperation operation)
        Create a context for the given HTTP request and GQL operation.
        Parameters:
        request - The HTTP request.
        operation - The GQL operation.
        Returns:
        The context instance.