Graphqlgen: Generated `Resolvers` interface not compatible with `IResolvers` from graphql-tools

0

image

Current workaround (add as any):

const server = new GraphQLServer({
  typeDefs: './src/schema.graphql',
  resolvers: resolvers as any,
  context: { data },
})

My current understanding is that this is a limitation in graphql-tools. We should open an issue there.

schickling picture schickling  ·  18 Oct 2018

Most helpful comment

6

See comment from above:

Current workaround (add as any):

const server = new GraphQLServer({
  typeDefs: './src/schema.graphql',
  resolvers: resolvers as any,
  context: { data },
})
schickling picture schickling  ·  29 Oct 2018

All comments

0

any workaround until it is fixed?

fedealconada picture fedealconada  ·  27 Oct 2018
6

See comment from above:

Current workaround (add as any):

const server = new GraphQLServer({
  typeDefs: './src/schema.graphql',
  resolvers: resolvers as any,
  context: { data },
})
schickling picture schickling  ·  29 Oct 2018
0

Same problem here

alexedev picture alexedev  ·  16 Nov 2018
0

I am using makeExecutableSchema.
For me the incompatibility with IResolvers was caused by a missing index signature. All generated resolvers should have it. As a workaround, I declare my resolvers as "...Resolvers.Type & { [key: string]: any } ".

rlux picture rlux  ·  6 Feb 2019
0

Duplicate of #15

And as stated here I don’t believe it’s a bug with graphqlgen
https://github.com/prisma/graphqlgen/issues/15#issuecomment-461024244

jasonkuhrt picture jasonkuhrt  ·  8 Feb 2019
Tags:
aregeneration
Source: Link