Ruby graphql-ruby: Difference between revisions

From wikinotes
 
(21 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[graphql]] gem for ruby.
[[graphql]] gem for ruby.
{{ TODO |
needs revisiting }}


= Documentation =
= Documentation =
Line 23: Line 20:
= Notes =
= Notes =
<blockquote>
<blockquote>
{|
{| class="wikitable"
|-
|-
| [[graphql-ruby basics]]
| [[graphql-ruby basics]]
|-
|-
| [[graphql-ruby fields]]
| [[graphql-ruby setup]]
|-
| [[graphql-ruby usage]]
|-
|-
| [[graphql-ruby mutations]]
| [[graphql-ruby datatypes]]
|-
|-
| [[graphql-ruby connections]]
| [[graphql-ruby errors]]
|-
|-
|}
|}
</blockquote><!-- Notes -->
</blockquote><!-- Notes -->


= Syntax =
= GraphQL Syntax =
<blockquote>
<blockquote>
== Objects ==
{| class="wikitable"
|-
| [[graphql-ruby objects]]
|-
| [[graphql-ruby queries]]
|-
| [[graphql-ruby mutations]]
|-
| [[graphql-ruby relationships]]
|-
| [[graphql-ruby subscriptions]]
|-
|}
</blockquote><!-- GraphQL Syntax -->
 
= Graphql-Ruby Feature Syntax =
<blockquote>
<blockquote>
 
{| class="wikitable"
{{ expand
|-
| Fields with Arguments
| [[graphql-ruby connections]]
|
|-
<source lang="ruby">
| [[graphql-ruby authorization]]
class User < GraphQL::Schema::Object
|-
  field :id, Integer    # name, returntype
| [[graphql-ruby dataloader]]
  field :age, Integer  # name, returntype
|-
end
| [[graphql-ruby testing]]
 
|-
class MyGraph < GraphQL::Schema::Object
|}
  field :user, User, do |field|
</blockquote><!-- Custom Syntax -->
    field.argument(:id, Integer, required: true)
  end
end
</source>
}}
</blockquote><!-- objects -->

Latest revision as of 14:23, 4 October 2021