You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The client can then execute requests with a `visibility_profile` parameter in context that specifies the name of any profile the supergraph was composed with, or nil:
64
+
The client can then execute requests with a `visibility_profile` parameter in context that specifies the name of any profile the supergraph was composed with:
65
65
66
66
```ruby
67
67
query =%|{
68
68
featuredProduct {
69
69
title # always visible
70
70
price # always visible
71
-
msrp # only visible to internal and nil profiles
72
-
id # only visible to nil profile
71
+
msrp # only visible to "private" or without profile
72
+
id # only visible without profile
73
73
}
74
74
}|
75
75
76
76
result = client.execute(query, context: {
77
-
visibility_profile:"public", # << or private, or nil
77
+
visibility_profile:"public", # << or "private"
78
78
})
79
79
```
80
80
81
81
The `visibility_profile` parameter will select which visibility distribution to use while introspecting and validating the request. For example:
82
82
83
83
- Using `visibility_profile: "public"` will say the `msrp` field does not exist (because it is restricted to "private").
84
84
- Using `visibility_profile: "private"` will accesses the `msrp` field as usual.
85
-
-Using `visibility_profile: nil` will access the entire graph without any visibility constraints.
85
+
-Providing no profile parameter (or `visibility_profile: nil`) will access the entire graph without any visibility constraints.
86
86
87
87
The full potential of visibility comes when hiding stitching implementation details, such as the `id` field (which is the stitching key for the Product type). While the `id` field is hidden from all named profiles, it remains operational for the stitching implementation.
88
88
@@ -105,7 +105,7 @@ end
105
105
106
106
## Merging visibilities
107
107
108
-
Visibility directives merge across schemas into the narrowest constraint possible. Profile sets for an element will intersect into its supergraph constraint:
108
+
Visibility directives merge across schemas into the narrowest constraint possible. Profiles for an element will intersect into its merged supergraph constraint:
0 commit comments