Skip to content

[1.10] Removed dynamic definition documentation #2179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 11, 2019

Conversation

abhaynikam
Copy link
Contributor

@abhaynikam
Copy link
Contributor Author

@rmosolgo Please have a look after CI is passed. Thanks

@rmosolgo rmosolgo merged commit 1ac6cf3 into rmosolgo:master Mar 11, 2019
@rmosolgo
Copy link
Owner

Thanks for taking care of this!

@rmosolgo rmosolgo mentioned this pull request Mar 11, 2019
14 tasks
@benbonnet
Copy link

Hello; was interested in such approach; was the previous version outdated ? Or should things be done another way ?

@rmosolgo
Copy link
Owner

Hi, in 1.8+, types can be defined using classes:

class Book < GraphQL::Schema::Object 
  # ... 
end 

So, if you want to dynamically define types, you can use plain old Ruby:

book_type = Class.new(GraphQL::Schema::Object) do 
  graphql_name "Book" 
  # ... 
end 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants