Skip to content
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

Use GraphQL for rendering Role page #3845

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
14 changes: 14 additions & 0 deletions app/models/role_graphql.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class RoleGraphql
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this (and the other for the world index) should be namespaced to keep them all together in one place? E.g. Graphql::Role?

attr_reader :content_item

def initialize(content_item)
@content_item = content_item
end

def self.find!(base_path)
query = Graphql::RoleQuery.new(base_path).query

edition = Services.publishing_api.graphql_query(query).dig("data", "edition")
new(edition)
end
end