@@ -26,41 +26,41 @@ extend schema @link(url: "https://specs.graphql-hive.com/hive/v1.0", import: ["@
26
26
27
27
Metadata is useful for a variety of cases:
28
28
29
- - Indicating granular ownership e.g. `owner: "console-team" `
30
- - Adding contact information e.g. `contact: "#hive-channel" `
31
- - Defining field importance e.g. `priority: "tier-1" `
32
- - Defining domains e.g. `domain: "users" `
29
+ - Indicating granular ownership e.g. `@meta ( name : " owner" , content : " console-team" ) `
30
+ - Adding contact information e.g. `@meta ( name : " contact" , content : " #hive-channel" ) `
31
+ - Defining field importance e.g. `@meta ( name : " priority" , content : " tier-1" ) `
32
+ - Defining domains e.g. `@meta ( name : " domain" , content : " users" ) `
33
33
34
34
... and more.
35
35
36
- Currently, metadata can be viewed from Hive’s explorer page and can be used to filter the explorer
37
- view. And we expect there will be even more features built around this metadata in the future as
38
- Hive continues to expand.
39
-
40
- A full example schema of using metadata would look like:
36
+ Putting it all together, an example schema using Hive's metadata might look like:
41
37
42
38
```graphql
43
39
extend schema
44
40
@link (url : " https://specs.apollo.dev/link/v1.0" )
45
41
@link (url : " https://specs.apollo.dev/federation/v2.3" )
46
42
@link (url : " https://specs.graphql-hive.com/hive/v1.0" , import : ["@meta" ])
47
- @meta (name : " owner" , content : " users-team " )
43
+ @meta (
name :
" owner" ,
content :
" [email protected] " )
48
44
49
45
directive @meta (
50
46
name : String !
51
47
content : String !
52
48
) repeatable on SCHEMA | OBJECT | INTERFACE | FIELD_DEFINITION
53
49
54
50
type Query {
55
- me : User @meta (name : "priority" , content : "tier-1" )
51
+ user : User @ meta ( name : "domain" , content : "accounts" ) @meta (name : "priority" , content : "tier-1" )
56
52
}
57
53
58
54
type User {
59
55
id : ID !
60
- name : String !
56
+ ssn : String @meta ( name : " classification " , content : " pii " )
61
57
}
62
58
```
63
59
60
+ Currently , metadata can be viewed from Hive ’s explorer page and can be used to filter the explorer
61
+ view . And we expect there will be even more features built around this metadata in the future as
62
+ Hive continues to expand .
63
+
64
64
---
65
65
66
66
[Learn more in the updated documentation ](/docs/specs/link-specifications)
0 commit comments