-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ztratify
committed
Nov 30, 2020
1 parent
c6e84df
commit 27fddbb
Showing
3 changed files
with
16 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
//= link_tree ../images | ||
//= link_directory ../stylesheets .css | ||
//= link graphiql/rails/application.css | ||
//= link graphiql/rails/application.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module Types | ||
class LinkType < Types::BaseObject | ||
field :id, ID, null: false | ||
field :url, String, null: false | ||
field :description, String, null: false | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
module Types | ||
class QueryType < Types::BaseObject | ||
# Add root-level fields here. | ||
# They will be entry points for queries on your schema. | ||
class QueryType < BaseObject | ||
# queries are just represented as fields | ||
# `all_links` is automatically camelcased to `allLinks` | ||
field :all_links, [LinkType], null: false | ||
|
||
# TODO: remove me | ||
field :test_field, String, null: false, | ||
description: "An example field added by the generator" | ||
def test_field | ||
"Hello World!" | ||
# this method is invoked, when `all_link` fields is being resolved | ||
def all_links | ||
Link.all | ||
end | ||
end | ||
end |