UNPKG

graphql-composer

Version:
33 lines (32 loc) 1.57 kB
import { GQLElement } from "../../classes"; import { GraphQLDirective, DirectiveLocationEnum, DirectiveDefinitionNode } from "graphql"; import { Arg } from ".."; import { Removable } from "../.."; export declare class DirectiveDefinition<ExtensionType = any> extends GQLElement<GraphQLDirective, any, ExtensionType> { private _locations; private _args; private _isRepeatable; get args(): Arg<string, any>[]; get locations(): ("QUERY" | "MUTATION" | "SUBSCRIPTION" | "FIELD" | "FRAGMENT_DEFINITION" | "FRAGMENT_SPREAD" | "INLINE_FRAGMENT" | "VARIABLE_DEFINITION" | "SCHEMA" | "SCALAR" | "OBJECT" | "FIELD_DEFINITION" | "ARGUMENT_DEFINITION" | "INTERFACE" | "UNION" | "ENUM" | "ENUM_VALUE" | "INPUT_OBJECT" | "INPUT_FIELD_DEFINITION")[]; get isRepeatable(): boolean; get definitionNode(): DirectiveDefinitionNode; protected constructor(name: string); static create(name: string): DirectiveDefinition; build(): GraphQLDirective; setLocations(...locations: DirectiveLocationEnum[]): this; addLocations(...locations: DirectiveLocationEnum[]): this; removeLocations(...locations: DirectiveLocationEnum[]): this; setIsRepeatable(isRepeatable: boolean): this; setArgs(...args: Arg<string>[]): this; /** * Add some arguments in the type * @param name The argument name * @param type The argument type */ addArgs(...args: Arg<string>[]): this; /** * Remove some arguments in the type * @param args The argument IDs */ removeArgs(...args: Removable<Arg<string>>): this; }