@servicenow/sdk - v4.13.3
    Preparing search index...

    Interface GraphQLResolver

    Resolver for one or more GraphQL schema fields (sys_graphql_resolver).

    interface GraphQLResolver {
        $id: string | number | ExplicitKey<string>;
        $meta?: {
            installMethod?: "first install" | "demo" | "once";
            useEsLatest?: boolean;
        };
        name: string;
        paths: string[];
        script: string
        | ((env: any) => unknown);
    }
    Index

    Properties

    $id: string | number | ExplicitKey<string>
    $meta?: {
        installMethod?: "first install" | "demo" | "once";
        useEsLatest?: boolean;
    }

    Type Declaration

    • OptionalinstallMethod?: "first install" | "demo" | "once"

      Map a record to an output folder that loads only in specific circumstances. 'first install' -> 'unload' (only loaded when plugin is first registered), 'demo' -> 'unload.demo' (only loaded when demo data is loaded), 'once' -> 'apply_once' (scripts that are only applied once)

    • OptionaluseEsLatest?: boolean

      Controls whether this record's server-side script field(s) run with the latest supported ECMAScript version rather than the application's default. Omit to leave the sys_app/now.config default in place. This setting applies to all fields defined for this entity

    name: string

    Identifier for the resolver, unique within the schema. The paths it serves point back to this name.

    paths: string[]

    Schema fields this resolver serves, each in Type:field form (for example Query:hello). One resolver mapping (sys_graphql_resolver_mapping) is created per path.

    script: string | ((env: any) => unknown)

    Server script that resolves the field value. Use a server module function, inline string, or Now.include('./resolver.js') to keep it in a separate file. For fields with arguments, read them with env.getArguments().