visitSchema.d.ts 1.0 KB

123456789101112131415161718192021
  1. import { GraphQLSchema, GraphQLType, GraphQLNamedType } from 'graphql';
  2. export declare enum VisitSchemaKind {
  3. TYPE = "VisitSchemaKind.TYPE",
  4. SCALAR_TYPE = "VisitSchemaKind.SCALAR_TYPE",
  5. ENUM_TYPE = "VisitSchemaKind.ENUM_TYPE",
  6. COMPOSITE_TYPE = "VisitSchemaKind.COMPOSITE_TYPE",
  7. OBJECT_TYPE = "VisitSchemaKind.OBJECT_TYPE",
  8. INPUT_OBJECT_TYPE = "VisitSchemaKind.INPUT_OBJECT_TYPE",
  9. ABSTRACT_TYPE = "VisitSchemaKind.ABSTRACT_TYPE",
  10. UNION_TYPE = "VisitSchemaKind.UNION_TYPE",
  11. INTERFACE_TYPE = "VisitSchemaKind.INTERFACE_TYPE",
  12. ROOT_OBJECT = "VisitSchemaKind.ROOT_OBJECT",
  13. QUERY = "VisitSchemaKind.QUERY",
  14. MUTATION = "VisitSchemaKind.MUTATION",
  15. SUBSCRIPTION = "VisitSchemaKind.SUBSCRIPTION"
  16. }
  17. export declare type SchemaVisitor = {
  18. [key: string]: TypeVisitor;
  19. };
  20. export declare type TypeVisitor = (type: GraphQLType, schema: GraphQLSchema) => GraphQLNamedType;
  21. export declare function visitSchema(schema: GraphQLSchema, visitor: SchemaVisitor, stripResolvers?: boolean): GraphQLSchema;