mock.d.ts 834 B

1234567891011121314
  1. import { GraphQLSchema, GraphQLList, GraphQLResolveInfo, GraphQLFieldResolver } from 'graphql';
  2. import { IMocks, IMockServer, IMockOptions, IMockTypeFn, ITypeDefinitions } from './Interfaces';
  3. declare function mockServer(schema: GraphQLSchema | ITypeDefinitions, mocks: IMocks, preserveResolvers?: boolean): IMockServer;
  4. declare function addMockFunctionsToSchema({ schema, mocks, preserveResolvers, }: IMockOptions): void;
  5. declare class MockList {
  6. private len;
  7. private wrappedFunction;
  8. constructor(len: number | number[], wrappedFunction?: GraphQLFieldResolver<any, any>);
  9. mock(root: any, args: {
  10. [key: string]: any;
  11. }, context: any, info: GraphQLResolveInfo, fieldType: GraphQLList<any>, mockTypeFunc: IMockTypeFn): any[];
  12. private randint;
  13. }
  14. export { addMockFunctionsToSchema, MockList, mockServer };