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
Copy file name to clipboardExpand all lines: guides/authorization/visibility.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -151,8 +151,8 @@ For big schemas, this can be a worthwhile speed-up.
151
151
-`Visibility` speeds up Rails app boot because it doesn't require all types to be loaded during boot and only loads types as they are used by queries.
152
152
-`Visibility` supports predefined, reusable visibility profiles which speeds up queries using complicated `visible?` checks.
153
153
-`Visibility` hides types differently in a few edge cases:
154
-
- Previously, `Warden`hide interface and union types which had no possible types. `Visibility` doesn't check possible types (in order to support performance improvements), so those types must return `false` for `visible?` in the same cases where all possible types were hidden. Otherwise, that interface or union type will be visible but have no possible types.
155
-
-Some other thing, see TODO
154
+
- Previously, `Warden`hid interface and union types which had no possible types. `Visibility` doesn't check possible types (in order to support performance improvements), so those types must return `false` for `visible?` in the same cases where all possible types were hidden. Otherwise, that interface or union type will be visible but have no possible types.
155
+
-When an object type is connected to the schema as a field return type or a union member, and also implements and interface, if the object type's _other_ connection(s) to the schema are hidden, then it won't appear as an implementer of that interface unless it's registered with `orphan_types` (either by the schema or interface). `Warden` used a "global" map of types so it could discover object types in this case, but `Visibility` doesn't have that global map. (Since time of writing, `Visibility`_does_ have some global type tracking, so maybe this could be fixed.)
156
156
- When `Visibility` is used, several (Ruby-level) Schema introspection methods don't work because the caches they draw on haven't been calculated (`Schema.references_to`, `Schema.union_memberships`). If you're using these, please get in touch so that we can find a way forward.
Copy file name to clipboardExpand all lines: guides/queries/timeout.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,15 +67,21 @@ end
67
67
68
68
Queries can originate from a user, and may be crafted in a manner to take a long time to validate against the schema.
69
69
70
-
It is possible to limit how many seconds the static validation rules and analysers are allowed to run before returning a validation timeout error. The default is no timeout.
70
+
It is possible to limit how many seconds the static validation rules and analysers are allowed to run before returning a validation timeout error. By default, validation and query analysis have a 3-second timeout. You can customize this timeout or disable it completely:
71
71
72
72
For example:
73
73
74
74
```ruby
75
+
# Customize timeout (in seconds)
75
76
classMySchema < GraphQL::Schema
76
77
# Applies to static validation and query analysis
77
78
validate_timeout 10
78
79
end
80
+
81
+
# OR disable timeout completely
82
+
classMySchema < GraphQL::Schema
83
+
validate_timeout nil
84
+
end
79
85
```
80
86
81
87
**Note:** This configuration uses Ruby's built-in `Timeout` API, which can interrupt IO calls mid-flight, resulting in [very weird bugs](https://www.mikeperham.com/2015/05/08/timeout-rubys-most-dangerous-api/). None of GraphQL-Ruby's validators make IO calls but if you want to use this configuration and you have custom static validators that make IO calls, open an issue to discuss implementing this in an IO-safe way.
0 commit comments