Comments (1)
Hey, sorry for my slow response to this. I just wrote up a replication:
require "bundler/inline"
gemfile do
gem "graphql", "2.3.5"
end
class MySchema < GraphQL::Schema
class AuthSource < GraphQL::Dataloader::Source
def fetch(objs)
puts "#{self.class}: #{objs}"
objs.map { |_o| true }
end
end
class Thing < GraphQL::Schema::Object
def self.authorized?(obj, ctx)
ctx.dataloader.with(AuthSource).load(obj)
end
field :name, String
end
class Query < GraphQL::Schema::Object
field :things, [Thing] do
argument :thing_ids, [ID], loads: Thing
end
def things(things:)
things
end
end
query(Query)
use GraphQL::Dataloader
def self.object_from_id(id, ctx)
OpenStruct.new(name: "Thing #{id}")
end
def self.resolve_type(abs_type, obj, ctx)
Thing
end
end
query_string = <<~GRAPHQL
{
things(thingIds: ["1", "2", "3"]) { name }
}
GRAPHQL
pp MySchema.execute(query_string).to_h
I'll work up a fix soon!
from graphql-ruby.
Related Issues (20)
- undefined method 'using_ast_analysis?' HOT 3
- Test helper run_graphql_field does not autoload arguments with graphql-batch HOT 4
- Load order for interfaces implementing interfaces HOT 6
- Using an orphaned "union type" doesn't properly restrict when loading HOT 1
- Including a union type in extra_types doesn't include its possible_types HOT 1
- Accept Distributed Trace Headers From New Relic HOT 2
- Optimize some predicate methods with `attr_reader`
- Argument default value is cached? HOT 1
- Pre-Execute CPU Time Management HOT 6
- Unable to find subscription with identifier: {"channel":"GraphqlChannel"} (RuntimeError) HOT 5
- Uninitialized constant GraphQL::Testing HOT 1
- Error raised (instead of error response) on argument value starting with `-` HOT 2
- Guide: Object Identification and SQIDs 🦑 HOT 2
- Confusing documentation for plugins HOT 1
- Feature Request: C parser workaround for line terminators in single quoted strings HOT 1
- Rubocop errors on GraphQL/FieldTypeInBlock in certain cases HOT 2
- Fast(er) serialization HOT 1
- Incorrect/incomplete error message
- [Enterprise] GraphqlController errors HOT 3
- Rubocop errors on GraphQL/FieldTypeInBlock for array types HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql-ruby.