@@ -5,7 +5,7 @@ title: Globally Unique Object Identification ("nodeId" / "id")
5
5
---
6
6
7
7
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 ) ,
9
9
so any table that has a primary key will automatically have a unique ` nodeId `
10
10
field available for queries and mutations. This is commonly used as the cache
11
11
key for your client library, e.g. with Apollo Client's ` dataIdFromObject ` :
@@ -28,17 +28,21 @@ export const client = new ApolloClient({
28
28
** WARNING** : by default, we call the Global Object Identifier ` nodeId ` to avoid
29
29
clashing with the ` id ` field that's common practice in database design. If you
30
30
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 ` .
33
33
34
- ### Disabling the Relay Global Object Identifier
34
+ ### Disabling the Global Object Identifier
35
35
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:
38
38
39
39
```
40
40
postgraphile --skip-plugins graphile-build:NodePlugin ...
41
41
```
42
42
43
43
Ensure that you have a good way of generating cache identifiers for your GraphQL
44
44
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