Skip to content
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.

Is the generated code compatible with Apollo server? #160

Closed
OrKoN opened this issue Oct 20, 2018 · 1 comment
Closed

Is the generated code compatible with Apollo server? #160

OrKoN opened this issue Oct 20, 2018 · 1 comment

Comments

@OrKoN
Copy link
Contributor

OrKoN commented Oct 20, 2018

Currently, I get the following error:

 error TS2345: Argument of type '{ typeDefs: DocumentNode; resolvers: Resolvers; }' is not assignable to parameter of type 'IExecutableSchemaDefinition<any>'.
  Types of property 'resolvers' are incompatible.
    Type 'Resolvers' is not assignable to type 'IResolvers<any, any> | IResolvers<any, any>[] | undefined'.
      Type 'Resolvers' is not assignable to type 'IResolvers<any, any>[]'.
        Property 'length' is missing in type 'Resolvers'.

I set up the apollo server in the following way:

import { graphqlExpress } from 'apollo-server-express/dist/expressApollo';
const schema = makeExecutableSchema({
  typeDefs,
  resolvers,
});

function graphql(req: HttpRequest, res: HttpResponse, next: NextFunction) {
  graphqlExpress({
    schema,
    context: req.ctx,
  })(req, res, next);
}

Perhaps I am doing something wrong here.

@schickling
Copy link
Contributor

This is already tracked here #124 and most likely a limitation in graphql-tools.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants