-
Notifications
You must be signed in to change notification settings - Fork 377
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
GraphQL: Report multiple query errors #4177
Draft
marcotc
wants to merge
17
commits into
master
Choose a base branch
from
graphql-error-event
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 3 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
d917334
GraphQL: Report multiple query errors
marcotc f8c134a
Merge branch 'master' into graphql-error-event
marcotc 9d7293d
wip
marcotc 81eaacc
wip
marcotc 87f61df
wip
marcotc 8d50b29
wip
marcotc 7ec4082
wip
marcotc 0e42da1
wip
marcotc 3c215ae
wip
marcotc 840c622
wip
marcotc 2b8b11c
wip
marcotc cd680ad
wip
marcotc 4404ee4
wip
marcotc 43fa1d1
wip
marcotc d56d8a0
wip
marcotc 1358ce2
wip
marcotc af565a0
wip
marcotc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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,25 +1,28 @@ | ||
module Datadog | ||
module Core | ||
class Error | ||
attr_reader type: untyped | ||
attr_reader type: String | ||
|
||
attr_reader message: untyped | ||
attr_reader message: String | ||
|
||
attr_reader backtrace: untyped | ||
attr_reader backtrace: String | ||
|
||
def self.build_from: (untyped value) -> untyped | ||
interface _ContainsMessage | ||
def message: () -> String | ||
end | ||
|
||
def self.build_from: ((Error | Array[untyped] | ::Exception | _ContainsMessage | ::String) value) -> Error | ||
|
||
private | ||
def self.full_backtrace: (untyped ex) -> untyped | ||
def self.backtrace_for: (untyped ex, untyped backtrace) -> (nil | untyped) | ||
def self.full_backtrace: (Exception ex) -> String | ||
def self.backtrace_for: (Exception ex, String backtrace) -> void | ||
|
||
public | ||
|
||
def initialize: (?untyped? `type`, ?untyped? message, ?untyped? backtrace) -> void | ||
|
||
BlankError: untyped | ||
def initialize: (?Object? `type`, ?Object? message, ?Object? backtrace) -> void | ||
|
||
ContainsMessage: untyped | ||
BlankError: Error | ||
ContainsMessage: ^(Object) -> bool | ||
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚪ Code Quality Violation
Optional arguments should appear at the end (...read more)
The rule "Optional arguments should appear at the end" is an important programming practice in Ruby. It is used to ensure that the optional parameters in a method definition are placed after the required parameters. This rule is important because when a method is called, Ruby fills in the arguments from left to right. If an optional argument is placed before a required argument and the method is called with fewer arguments, Ruby will assign the provided arguments to the optional parameters, leaving the required parameters without values and causing an error.
Non-compliance with this rule often leads to unexpected behavior or bugs in the code, which can be quite challenging to debug. This is particularly true when the method is called with fewer arguments than defined. The errors caused by this can be hard to track down, as they may not occur at the place where the method is defined, but rather in some distant place where the method is called.
To avoid this, always place optional parameters at the end of the list of parameters in your method definitions. This way, Ruby will fill in the required parameters first, and only then use any remaining arguments for the optional ones. If there are no remaining arguments, the optional parameters will be set to their default values. This keeps your code clear, predictable, and free of unnecessary bugs.