Hi everyone, since upgrading to the latest prisma ...
# orm-help
m
Hi everyone, since upgrading to the latest prisma version I ah getting an error as such:
Copy code
Type '{ users: (parent: any, args: any, context: any, info: GraphQLResolveInfo) => any; profiles: (pare...' is not assignable to type 'GraphQLScalarType'.
            Property 'name' is missing in type '{ users: (parent: any, args: any, context: any, info: GraphQLResolveInfo) => any; profiles: (pare...'. (2345)
in the initialisation of my Prisma server. It is complaining about a file as such:
Copy code
export const Query = {
  users: forwardTo("db"),
  profile(parent, { id }, ctx: Context, info) {
    return ctx.db.query.profile({ where: { id } }, info);
  },
}
What is the reason for this? Has the query format changed? Thanks!
n
can you share the entry of
schema.graphql
for those two resolvers?
m
Ahh, your question answered mine 🙂 There was indeed a type error in the
user
resolver. Thanks. The log was a little unclear to me.
However, the issue is still there after fixing the obvious issue. Here is the schema:
Copy code
profile(id: ID!): Profile!
  # USER
  users(
    where: UserWhereInput
    orderBy: UserOrderByInput
    skip: Int
    after: String
    before: String
    first: Int
    last: Int
  ): [User]!
n
what is the error message now?
also, did you redefine the
User
type in
schema.graphql
?
m
I did not.
n
is the error message the same?
m
Same error message:
Copy code
"src/index.ts (6,34): Argument of type '{ typeDefs: string; resolvers: { Query: { users: (parent: any, args: any, context: any, info: Gra...' is not assignable to parameter of type 'Props'.
  Types of property 'resolvers' are incompatible.
    Type '{ Query: { users: (parent: any, args: any, context: any, info: GraphQLResolveInfo) => any; profil...' is not assignable to type 'IResolvers'.
      Property 'Query' is incompatible with index signature.
        Type '{ users: (parent: any, args: any, context: any, info: GraphQLResolveInfo) => any; profiles: (pare...' is not assignable to type '(() => any) | IResolverObject | GraphQLScalarType'.
          Type '{ users: (parent: any, args: any, context: any, info: GraphQLResolveInfo) => any; profiles: (pare...' is not assignable to type 'GraphQLScalarType'.
            Property 'name' is missing in type '{ users: (parent: any, args: any, context: any, info: GraphQLResolveInfo) => any; profiles: (pare...'. (2345)
"
I will check on my schemas git history and check what I could have done to cause this. Maybe this was not the prisma update at all.
n
you said you upgraded to the latest primsa version, did you upgrade
prisma-binding
as well?
m
Ill check and get back in 2 minutes
I bumped prisma binding, but nothing changed
I will check weather it is an issue arising with prisma 1.8.3 by deploying a version I deployed successfully earlier.
@nilan I can now confirm that I am getting some weirs side effects when upgrading prisma-bindings and prisma, i.e. I cannot deploy a previously working version any more. When bumping the version, I get this
Copy code
Type "Node" is missing a "resolveType" resolver. Pass false into "resolverValidationOptions.requireResolversForResolveType" to disable this warning.
Server is running on <http://localhost:4000>
Serving playground at <http://localhost:3000/playground>
TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at XXX/node_modules/graphql-binding/node_modules/graphql-tools/src/stitching/delegateToSchema.ts:54:12
Might this be related to the issue experienced above?
Also, I am getting the warning
Copy code
Type "Node" is missing a "resolveType" resolver. Pass false into "resolverValidationOptions.requireResolversForResolveType" to disable this warning.
Possibly related?
n
what was your previous version of
prisma-binding
and what is your new version?
m
Ok I will dig deeper and get back, not sure what exacly is going on here.
n
oki!
m
Hi @nilan, this was a rather obscured result of the schema file not being regenerated after bumping prisma-bindings version. It is now fixed. Is there a short update guide for mayor prisma/prisma-bindings upgrades to avoid such confustion in the future? I mostly look at the ts-advanced boilerplate for upgrades. Also, wouldnt it be a good idea to always delete the old
src/generated
folder as the first post deployment hook to make sure that the actual problem is not obscured as above due to old schema versions? Thx for your patience.