diff --git a/object_cache/caching.html b/object_cache/caching.html index 13ed24b0dc..942513ae7b 100644 --- a/object_cache/caching.html +++ b/object_cache/caching.html @@ -280,6 +280,14 @@

Top-level lists

end +

If you’re using GraphQL::Schema::Resolver, you’d call .items_for slightly differently:

+ +
def resolve(division: nil)
+  # use `context[:current_object]` to get the GraphQL::Schema::Object instance whose field is being resolved
+  AllTeams.items_for(context[:current_object], division: division)
+end
+
+

Finally, you’ll need to handle CacheableRelations in your object identification methods, for example:

class MySchema < GraphQL::Schema
@@ -302,12 +310,12 @@ 

Top-level lists

end
-

In this example, AllTeams takes care of integrating with the cache:

+

In this example, AllTeams implements several methods to support caching:

This way, if a Team is created, the cached result will be invalidated and a fresh result will be created.

diff --git a/yardoc/GraphQL_Schema_Resolver.html b/yardoc/GraphQL_Schema_Resolver.html index 5c9b63a492..12e5250c79 100644 --- a/yardoc/GraphQL_Schema_Resolver.html +++ b/yardoc/GraphQL_Schema_Resolver.html @@ -30,6 +30,7 @@ GraphQL::Schema::Member::GraphQLTypeNames Extended by: GraphQL::Schema::Member::BaseDSLMethods, +GraphQL::Schema::Member::BaseDSLMethods::ConfigurationExtension, GraphQL::Schema::Member::HasArguments, GraphQL::Schema::Member::HasValidators, GraphQL::Schema::Member::HasPath,