-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
1 parent
153b1e3
commit 5ea9db4
Showing
8 changed files
with
105 additions
and
81 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,21 @@ | ||
# frozen_string_literal: true | ||
|
||
module Refinery | ||
module Api | ||
module Fields | ||
module Pages | ||
PageField = GraphQL::Field.define do | ||
name 'Page' | ||
description 'Find a page by ID' | ||
|
||
type Types::Pages::PageType | ||
argument :id, !types.ID | ||
|
||
resolve -> (obj, args, ctx) { | ||
Refinery::Page.find_by_id(args[:id]) | ||
} | ||
end | ||
end | ||
end | ||
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# frozen_string_literal: true | ||
|
||
module Refinery | ||
module Api | ||
module Fields | ||
module Pages | ||
PagesField = GraphQL::Field.define do | ||
name 'Pages' | ||
description 'Find all pages' | ||
|
||
type types[Types::Pages::PageType] | ||
|
||
resolve -> (obj, args, ctx) { | ||
Refinery::Page.all | ||
} | ||
end | ||
end | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,23 @@ | ||
# frozen_string_literal: true | ||
|
||
module Refinery | ||
module Api | ||
module Types | ||
module Pages | ||
PagePartType = GraphQL::ObjectType.define do | ||
name "PagePart" | ||
description "A PagePart" | ||
|
||
interfaces [Types::ActiveRecordInterface] | ||
|
||
field :slug, types.String | ||
field :position, types.Int | ||
field :title, types.String | ||
|
||
field :locale, types.String | ||
field :body, types.String | ||
end | ||
end | ||
end | ||
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# frozen_string_literal: true | ||
|
||
module Refinery | ||
module Api | ||
module Types | ||
module Pages | ||
PageType = GraphQL::ObjectType.define do | ||
name "Page" | ||
description "A Page" | ||
|
||
interfaces [Types::ActiveRecordInterface] | ||
|
||
field :parent_id, types.Int | ||
field :path, types.String | ||
field :show_in_menu, types.Boolean | ||
field :link_url, types.String | ||
field :menu_match, types.String | ||
field :deletable, types.Boolean | ||
field :draft, types.Boolean | ||
field :skip_to_first_child, types.Boolean | ||
field :lft, types.Int | ||
field :rgt, types.Int | ||
field :depth, types.Int | ||
field :view_template, types.String | ||
field :layout_template, types.String | ||
field :locale, types.String | ||
field :title, types.String | ||
field :custom_slug, types.String | ||
field :menu_title, types.String | ||
field :slug, types.String | ||
field :meta_description, types.String | ||
field :browser_title, types.String | ||
|
||
field :parts, types[Types::Pages::PagePartType] | ||
end | ||
end | ||
end | ||
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