Skip to content

Request Error #38

@wearstudio

Description

@wearstudio

Hi! Our backend team create schema with mutation

--data '{"query":"mutation Login { login(input: { email: "[email protected]", password: "aasdasd" })
{ __typename, ...on LoginAuthToken { accessToken refreshToken }, ...on InvalidCredentials
{ message } }}"}'

In unity inspector it look like

image

When I try to execute query i have error
GraphApi.Query query = _requests.GetQueryByName("Login", GraphApi.Query.Type.Mutation);
var result = await _requests.Post(query);
Debug.Log(result.downloadHandler.text);

{"errors":[{"message":"Field "login" of type "LoginUserResult!" must have a selection of subfields. Did you mean "login { ... }"?","extensions":{"code":"GRAPHQL_VALIDATION_FAILED","exception":{"stacktrace":["GraphQLError: Field "login" of
type "LoginUserResult!" must have a selection of subfields. Did you mean "login { ... }"?","
at Object.Field (/app/node_modules/graphql/validation/rules/ScalarLeafsRule.js:40:31)","
at Object.enter (/app/node_modules/graphql/language/visitor.js:323:29)","
at Object.enter (/app/node_modules/graphql/utilities/TypeInfo.js:370:25)","
at visit (/app/node_modules/graphql/language/visitor.js:243:26)","
at validate (/app/node_modules/graphql/validation/validate.js:69:24)","
at validate (/app/node_modules/apollo-server-core/dist/requestPipeline.js:187:39)","
at processGraphQLRequest (/app/node_modules/apollo-server-core/dist/requestPipeline.js:90:34)","
at runMicrotasks ()"," at processTicksAndRejections (node:internal/process/task_queues:96:5)","
at async processHTTPRequest (/app/node_modules/apollo-server-core/dist/runHttpQuery.js:187:30)"]}}}]}

Can you help me?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions