buildClientSchema.d.ts 866 B

123456789101112131415161718192021
  1. import { IntrospectionQuery } from './introspectionQuery';
  2. import { GraphQLSchema, GraphQLSchemaValidationOptions } from '../type/schema';
  3. interface Options extends GraphQLSchemaValidationOptions {}
  4. /**
  5. * Build a GraphQLSchema for use by client tools.
  6. *
  7. * Given the result of a client running the introspection query, creates and
  8. * returns a GraphQLSchema instance which can be then used with all graphql-js
  9. * tools, but cannot be used to execute a query, as introspection does not
  10. * represent the "resolver", "parse" or "serialize" functions or any other
  11. * server-internal mechanisms.
  12. *
  13. * This function expects a complete introspection result. Don't forget to check
  14. * the "errors" field of a server response before calling this function.
  15. */
  16. export function buildClientSchema(
  17. introspection: IntrospectionQuery,
  18. options?: Options,
  19. ): GraphQLSchema;