Gabriel Oliveira
10/26/2020, 11:04 PMRyan
10/27/2020, 6:30 AMprisma deploy
would only be required if you changed the datamodel.graphql
file that contains your DB tables.
So changing your user facing schema.graphql
should just work fine when you reload your Node app.Gabriel Oliveira
10/27/2020, 10:48 AMGabriel Oliveira
10/27/2020, 10:50 AMGabriel Oliveira
10/27/2020, 10:50 AMServer is up and running
[GraphQL error]: Message: Variable '$_v0_data' expected value of type 'UserUpdateInput!' but got: {"userId":"null","name":"grf3 2","email":"<mailto:grf3@grf.com|grf3@grf.com>","phone":"+148996814365"}. Reason: 'userId' Field 'userId' is not defined in the input type 'UserUpdateInput'. (line 1, column 11):
mutation ($_v0_data: UserUpdateInput!, $_v1_where: UserWhereUniqueInput!) {
^, Location: [object Object], Path: undefined
[Network error]: Error: Variable '$_v0_data' expected value of type 'UserUpdateInput!' but got: {"userId":"null","name":"grf3 2","email":"<mailto:grf3@grf.com|grf3@grf.com>","phone":"+148996814365"}. Reason: 'userId' Field 'userId' is not defined in the input type 'UserUpdateInput'. (line 1, column 11):
mutation ($_v0_data: UserUpdateInput!, $_v1_where: UserWhereUniqueInput!) {
^
Error: Variable '$_v0_data' expected value of type 'UserUpdateInput!' but got: {"userId":"null","name":"grf3 2","email":"<mailto:grf3@grf.com|grf3@grf.com>","phone":"+148996814365"}. Reason: 'userId' Field 'userId' is not defined in the input type 'UserUpdateInput'. (line 1, column 11):
mutation ($_v0_data: UserUpdateInput!, $_v1_where: UserWhereUniqueInput!) {
^
at BatchedGraphQLClient.<anonymous> (/home/grf/projects/backend-telemedcan/telemedcan/node_modules/http-link-dataloader/src/BatchedGraphQLClient.ts:74:13)
at step (/home/grf/projects/backend-telemedcan/telemedcan/node_modules/http-link-dataloader/dist/src/BatchedGraphQLClient.js:40:23)
at Object.next (/home/grf/projects/backend-telemedcan/telemedcan/node_modules/http-link-dataloader/dist/src/BatchedGraphQLClient.js:21:53)
at fulfilled (/home/grf/projects/backend-telemedcan/telemedcan/node_modules/http-link-dataloader/dist/src/BatchedGraphQLClient.js:12:58)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
Ryan
10/27/2020, 10:54 AMUserUpdateInput
(here it’s complaining about userId
) then it should not throw an error. I assume that you are adding these manually to your schema.graphql
and not using Nexus?Gabriel Oliveira
10/27/2020, 11:17 AMGabriel Oliveira
10/27/2020, 11:22 AMRyan
10/27/2020, 2:01 PMpackage.json
. I would need that to check it on my endGabriel Oliveira
10/27/2020, 2:15 PMGabriel Oliveira
10/28/2020, 1:39 AMError: Variable "$_v0_data" got invalid value {"userId":"ckgjxrrd6000o0801qifmvgyj","name":"grf3 32","email":"<mailto:grf3@grf.com|grf3@grf.com>","phone":"<tel:+148996814365|+148996814365>"}; Field "userId" is not defined by type UserUpdateInput.
Adding this property back in, the error comes back to the one I mentioned above when starting this thread.
Now if I remove this property from the other file, schema.graphql, on UpdateUserInput, I get the error below, but this time the error comes in the response of the http post for the graqhql query:
{"errors":[{"message":"Field \"userId\" is not defined by type UpdateUserInput.","locations":[{"line":4,"column":9}]}]}
This tells me that, the changes are being accounted for, like you mentioned @Ryan when changing the schema.graphl, and obviously prima.graphql too, theres no need to run any prisma CLI command, just reload the app.
But the error I have added to the first post of this thread still persists and it's really boggling my mind...
Also, I wonder if there is a better way to debug this (I'm assuming this is not a bug on prisma or any other module/package though), I'm quite stuck right now with this errorGabriel Oliveira
10/29/2020, 10:32 PMReason: 'userId' Field 'userId' is not defined in the input type 'UserUpdateInput'. (line 1, column 11):
I still can't wrap my head around the relation between what I did (adding a new field to a mutation) and this message saying that the field does not exist in that Input when in fact it does.
I wonder if I can dig more into this error by getting more detailed error information, when running the query, or finding a way to intercept those calls in a debug state in vscode etc... anything you would recommend?Ryan
10/30/2020, 7:19 AMGabriel Oliveira
10/30/2020, 12:09 PMRyan
10/30/2020, 12:32 PMdev
command. Could you provide me all the files required to run the project?