apollo-client-mock icon indicating copy to clipboard operation
apollo-client-mock copied to clipboard

Add typescript definitions

Open moonray opened this issue 6 years ago • 1 comments

It would be great to have typescript support.

moonray avatar Feb 08 '19 14:02 moonray

This is the type definition that I believe should work.

declare module 'apollo-client-mock' {
  import { NormalizedCacheObject } from 'apollo-cache-inmemory';
  import { ApolloClient } from 'apollo-client';
  import { ITypeDefinitions, IMocks } from 'graphql-tools';

  export default function setupClient(
    mockResolvers: IMocks,
    typeDefs: ITypeDefinitions
  ): () => ApolloClient<NormalizedCacheObject>;
}

moonray avatar Feb 08 '19 15:02 moonray