-
Notifications
You must be signed in to change notification settings - Fork 39
Closed
Labels
help wantedExtra attention is neededExtra attention is needed
Description
Hello,
Using GraphQL Ruby Multiplex with Apollo Batch Http Link, this user type works fine
def user(id:)
user = User.find(id)
cache_fragment([user, context[:current_user]]) do
user
end
end
but when I try to add GraphQL batch here
def user(id:)
Loaders::RecordLoader.for(User).load(id).then do |user|
cache_fragment([user, context[:current_user]]) do
user
end
end
end
I get this error:
undefined method `map' for nil:NilClass
/Users/jpalumickas/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/graphql-fragment_cache-1.4.0/lib/graphql/fragment_cache/cache_key_builder.rb:147:in `block in path_cache_key'
/Users/jpalumickas/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/graphql-fragment_cache-1.4.0/lib/graphql/fragment_cache/cache_key_builder.rb:144:in `fetch'
Also, this type with Batch works fine when using without Apollo Batch (calling single query)
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is needed