Postgraphile: Is it still Relay-compliant that Node's id is "nodeId" instead of "id" ?

Created on 20 Feb 2017  路  4Comments  路  Source: graphile/postgraphile

From http://facebook.github.io/relay/graphql/objectidentification.htm it indicates that the introspection should return

{
  "__type": {
    "name": "Node",
    "kind": "INTERFACE",
    "fields": [
      {
        "name": "id",
        "type": {
          "kind": "NON_NULL",
          "ofType": {
            "name": "ID",
            "kind": "SCALAR"
          }
        }
      }
    ]
  }
}

But when I tested PostgraphQL it returns :

{
  "data": {
    "__type": {
      "name": "Node",
      "kind": "INTERFACE",
      "fields": [
        {
          "name": "nodeId",
          "type": {
            "kind": "NON_NULL",
            "ofType": {
              "name": "ID",
              "kind": "SCALAR"
            }
          }
        }
      ]
    }
  }
}

So I am wondering if Relay still functioning correctly despite this? (cache, optimistic update, etc.)

Most helpful comment

Perhaps we should consider making --classic-ids the default again now? 馃

But yeah, --classic-ids is required for Relay 1 support. I鈥檒l close. Let me know if you have any more questions for us 馃槉

All 4 comments

Look into --classic-ids; this change is to make it so the common id field for database tables doesn't conflict with the Relay one (which was __id until recently).

Perhaps we should consider making --classic-ids the default again now? 馃

But yeah, --classic-ids is required for Relay 1 support. I鈥檒l close. Let me know if you have any more questions for us 馃槉

@benjie @calebmer I have a question about current state of art

I'm using relay modern 1.7, postgraphile generates schema with nodeId: ID! (global id), id: Int (row id)

I have an error during rendering Invariant Violation: RelayResponseNormalizer: Expected id of elements of field nodes to be strings

  1. Do I need to use --classic-ids (documentation)?
  2. OR Can I pass setting to relay to change default global id field from id to nodeId? (I dont understand does relay now support this feature after https://github.com/facebook/relay/issues/1061)

Unsure; I don't use Relay and any time I've tested with it I've always used --classic-ids. @chadfurman can you shed some light as you're more familiar with Relay than I?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mrbarletta picture mrbarletta  路  5Comments

tazsingh picture tazsingh  路  3Comments

Venryx picture Venryx  路  4Comments

jayp picture jayp  路  3Comments

giacomorebonato picture giacomorebonato  路  3Comments