DSL compiler for `GraphQL::Schema::ObjectType`
Open
Nobody has claimed this yet.
enhancement
help-wanted
- Dominant language
- Ruby
- Stars
- 873
- Forks
- 164
- Avg merge
- 4d 27m
- Merged PRs (30d)
- 9
Description
When using field in GraphQL object types, new methods are created in the class dynamically. In certain occasions, like in batch loading, we need to be able to refer to those methods and avoid type checking errors.
class MyType < GraphQL::Schema::Object
field "foo", type: String
class << self
extend T::Sig
sig { params(objects: T::Array[MyType]).void }
def load_foo(objects)
objects.each { |obj| obj.foo = "hello!" }
# ^ error: foo doesn't exist on MyType
end
end
end
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the GraphQL::Schema::Object example in the issue and inspect how Tapioca currently handles DSL compilers. Determine how dynamically defined field methods should be represented for Sorbet, then verify that batch-loading code can refer to obj.foo without a type error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100