Ruby graphql-ruby: Difference between revisions

From wikinotes
No edit summary
 
(15 intermediate revisions by the same user not shown)
Line 25: Line 25:
|-
|-
| [[graphql-ruby setup]]
| [[graphql-ruby setup]]
|-
| [[graphql-ruby usage]]
|-
|-
| [[graphql-ruby datatypes]]
| [[graphql-ruby datatypes]]
Line 33: Line 35:
</blockquote><!-- Notes -->
</blockquote><!-- Notes -->


= Syntax =
= GraphQL Syntax =
<blockquote>
<blockquote>
{| class="wikitable"
{| class="wikitable"
|-
| [[graphql-ruby fields]]
|-
|-
| [[graphql-ruby objects]]
| [[graphql-ruby objects]]
Line 45: Line 45:
| [[graphql-ruby mutations]]
| [[graphql-ruby mutations]]
|-
|-
| [[graphql-ruby connections]]
| [[graphql-ruby relationships]]
|-
| [[graphql-ruby subscriptions]]
|-
|-
|}
|}
</blockquote><!-- Syntax -->
</blockquote><!-- GraphQL Syntax -->


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

Latest revision as of 14:23, 4 October 2021