Skip to content

toGraphQL gets null type for enum variable #1256

Closed
X-oss-byte/next.js
#1421
@papigers

Description

@papigers

I'm using isomorphic-relay, and I'm encountering some problem, which you can read about in more details here.

The relevant part for you, is that I saw the server's preloaded data looks like this:

...
...
{
          "children": [
            {
              "calls": [
                {
                  "kind": "Call",
                  "name": "orderBy",
                  "metadata": {
                    "type": null
                  },
                  "value": {
                    "kind": "CallValue",
                    "callValue": "TRENDING"
                  }
                },
                {
                  "kind": "Call",
                  "name": "first",
...
...

Here you can see that the type of orderBy is null, instead of PollSort, an enum type.

The above snippet is, as mentioned, part of the preloaded data the server passed to the client. This is done in this file: prepareData.js. The relevant line is:

data.push({ query: toGraphQL.Query(request.getQuery()), response });

So the root of the problem is actually that toGraphQL.Query returns null for my input variable type.

Any idea how can this be fixed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions