How to use the graphql-relay.backwardConnectionArgs.last function in graphql-relay

To help you get started, we’ve selected a few graphql-relay examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / graphql-relay / graphql-relay-tests.ts View on Github external
pluralIdentifyingRootField,
    // Mutations
    mutationWithClientMutationId,
} from "graphql-relay";
// Connections
// connectionArgs returns the arguments that fields should provide when they return a connection type that supports bidirectional pagination.
connectionArgs.first = 10;
connectionArgs.after = "a";
connectionArgs.before = "b";
connectionArgs.last = 10;
// forwardConnectionArgs returns the arguments that fields should provide when they return a connection type that only supports forward pagination.
forwardConnectionArgs.after = "a";
forwardConnectionArgs.first = 10;
// backwardConnectionArgs returns the arguments that fields should provide when they return a connection type that only supports backward pagination.
backwardConnectionArgs.before = "b";
backwardConnectionArgs.last = 10;
// connectionDefinitions returns a connectionType and its associated edgeType, given a node type.
const resolve: GraphQLFieldResolver = (source, args, context, info) => {
    info.fieldName = "f";
};
const fields: GraphQLFieldConfigMap = {};
let t: GraphQLObjectType;
let e: GraphQLObjectType;
const def = connectionDefinitions({
    connectionFields: fields,
    edgeFields: fields,
    name: "N",
    nodeType: new GraphQLObjectType({
        name: "N",
        fields: {},
    }),
    resolveCursor: resolve,