Skip to content

graphql: Add types for GraphQL::ExecutionError#initialize #871

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 2 commits into from
Jun 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions gems/graphql/1.12/_test/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ def ping = context[:ping]
field :article, String, null: false do
argument :id, ID, required: true
end

field :error_field, String, null: false
def error_field
raise GraphQL::ExecutionError.new("Test error message", ast_node: nil, extensions: { "code" => "TEST_ERROR" })
end
end
end

Expand Down
2 changes: 2 additions & 0 deletions gems/graphql/1.12/_test/test.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ module Types
include GraphQL::Types::Relay::HasNodeField

def ping: -> untyped

def error_field: -> untyped
end
end

Expand Down
1 change: 1 addition & 0 deletions gems/graphql/1.12/graphql.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ module GraphQL
class Error < StandardError
end
class ExecutionError < Error
def initialize: (String message, ?ast_node: untyped, ?extensions: Hash[untyped, untyped]?) -> void
def to_h: () -> Hash[String, untyped]
end
class RequiredImplementationMissingError < Error
Expand Down