GraphQL : the object name is defined in resolvers, but not in schema

后端 未结 4 1301
说谎
说谎 2021-02-20 00:01

I want to define a mutation using graphql.

My mutation is getting an object as argument. So I defined the new Object in the schema and in the resolver using GraphQLObjec

4条回答
  •  你的背包
    2021-02-20 00:32

    I came across this error when migrating from v1 of apollo-server-express to v2, the error had to do with Uploads not being defined in schema. Now when declaring you graphql schema you can use the option set uploads: false

    // GraphQL: Schema
    const SERVER = new ApolloServer({
      typeDefs: typeDefs,
      resolvers: resolvers,
      introspection: true,
      uploads: false,
      playground: {
        endpoint: `http://localhost:3000/graphql`,
        settings: {
          'editor.theme': 'light'
        }
      }
    });
    

    Appears to solve the issue in this case if your error is Uploads specific

提交回复
热议问题