Skip to content

Add a GraphQL endpoint #134

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

Merged
merged 26 commits into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rubocop
  • Loading branch information
patch0 committed Feb 17, 2023
commit 4244e660e1f02c9a7e6a05809dc7c3e02de959e1
5 changes: 3 additions & 2 deletions app/graphql/editor_api_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@ def self.resolve_type(_abstract_type, obj, _ctx)
end
end


def self.unauthorized_object(error)
# Add a top-level error to the response instead of returning nil:
raise GraphQL::ExecutionError, "An object of type #{error.type.graphql_name} was hidden due to permissions"
end

def self.unauthorized_field(error)
# Add a top-level error to the response instead of returning nil:
raise GraphQL::ExecutionError, "The field #{error.field.graphql_name} on an object of type #{error.type.graphql_name} was hidden due to permissions"
raise GraphQL::ExecutionError,
"The field #{error.field.graphql_name} on " \
"an object of type #{error.type.graphql_name} was hidden due to permissions"
end

# Stop validating when it encounters this many errors:
Expand Down
2 changes: 2 additions & 0 deletions app/graphql/mutations/create_project.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Mutations
class CreateProject < BaseMutation
field :project, Types::ProjectType, null: false
Expand Down