buildClientSchema.d.ts 832 B

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