Skip to content

Commit 56ab567

Browse files
authored
Correct "GraphQL Global Object Identification Specification" (#319)
1 parent 07465b0 commit 56ab567

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/pages/postgraphile/node-id.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: Globally Unique Object Identification ("nodeId" / "id")
55
---
66

77
We implement the
8-
[Relay Global Object Identification Specification](https://facebook.github.io/relay/graphql/objectidentification.htm),
8+
[GraphQL Global Object Identification Specification](https://facebook.github.io/relay/graphql/objectidentification.htm),
99
so any table that has a primary key will automatically have a unique `nodeId`
1010
field available for queries and mutations. This is commonly used as the cache
1111
key for your client library, e.g. with Apollo Client's `dataIdFromObject`:
@@ -28,17 +28,21 @@ export const client = new ApolloClient({
2828
**WARNING**: by default, we call the Global Object Identifier `nodeId` to avoid
2929
clashing with the `id` field that's common practice in database design. If you
3030
wish to call the Global Object Identifier field `id` instead (as is mandated by
31-
the Relay specification), you can do so with our `--classic-ids` CLI flag. In
32-
doing so, any `id` column will automatically be renamed to `rowId`.
31+
the specification), you can do so with our `--classic-ids` CLI flag. In doing
32+
so, any `id` column will automatically be renamed to `rowId`.
3333

34-
### Disabling the Relay Global Object Identifier
34+
### Disabling the Global Object Identifier
3535

36-
You can disable the relay global object identifier throughout your API by
37-
skipping the `require('graphile-build').NodePlugin` plugin; e.g. from the CLI:
36+
You can disable the global object identifier throughout your API by skipping
37+
the `require('graphile-build').NodePlugin` plugin; e.g. from the CLI:
3838

3939
```
4040
postgraphile --skip-plugins graphile-build:NodePlugin ...
4141
```
4242

4343
Ensure that you have a good way of generating cache identifiers for your GraphQL
4444
client though!
45+
46+
(Note: the GraphQL Global Object Identification Specification was previously
47+
known as the Relay Global Object Identification Specification, but it's not
48+
specific to Relay.)

0 commit comments

Comments
 (0)