Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connectionFromPromisedArray and PageInfo spec #240

Closed
MarshHawk opened this issue Mar 11, 2020 · 1 comment
Closed

connectionFromPromisedArray and PageInfo spec #240

MarshHawk opened this issue Mar 11, 2020 · 1 comment

Comments

@MarshHawk
Copy link

Hi all,

When connectionFromPromisedArray resolves from an empty array, startCursor and endCursor are null. However, the Connection spec specifies non-null:

          "name": "startCursor",
          "type": {
            "name": null,
            "kind": "NON_NULL",
            "ofType": {
              "name": "String",
              "kind": "SCALAR"
            }
          }
        },
        {
          "name": "endCursor",
          "type": {
            "name": null,
            "kind": "NON_NULL",
            "ofType": {
              "name": "String",
              "kind": "SCALAR"
            }
          }
        }

e.g.:

const conn = await connectionFromPromisedArray(
        Promise.resolve([]),
        {first: 2}
      );

which yields the following for conn:

{
  edges: [],
  pageInfo: {
    startCursor: null,
    endCursor: null,
    hasPreviousPage: false,
    hasNextPage: false
  }
}
@IvanGoncharov
Copy link
Member

Closing as duplicate in favor of #243

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants