-
Notifications
You must be signed in to change notification settings - Fork 2
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
Package update #17
Package update #17
Conversation
Support for embedded struct type in resolver
Adding example and documentation for how to create custom error implementations which include `extensions` within their `error` payload
…tom-errors Add Example of Custom Errors
Print context to panic log
Producing clearer error messages when field input arguments are implemented by code: * Which does not match the schema e.g. missing field; or * Function missing struct wrapper for field arguments
…input-resolver-mismatch-with-schema Clarify errors for mismatching input implementation
…ntrypoints-without-explicit-schema Allow `schema` to be omitted when using default root op names
Fix graph-gophers#357 - Allow passing integers as arguments to graphql.Time parameters
Multi-line descriptions need to have their common indentation level (which results from indentation of that part of the schema, rather than being intentional for the description text) removed to ensure the descriptions use the correct value, are formatted correctly etc This is to meet the condition documented in the GraphQL spec: https://graphql.github.io/graphql-spec/June2018/#sec-String-Value > Since block strings represent freeform text often used in indented > positions, the string value semantics of a block string excludes > uniform indentation and blank initial and trailing lines via > BlockStringValue().
…tation-from-blockstring-descriptions Strip Common Indentation from BlockString Descriptions
Syntax highlighting fixed in README
Fixed small punctuation and added my walkthrough package
Adding walkthrough
Added changes lost after package update
Readded Export query name method functionality after package update
Path []interface{} `json:"path,omitempty"` | ||
Rule string `json:"-"` | ||
ResolverError error `json:"-"` | ||
Extensions map[string]interface{} `json:"extensions"` |
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.
Updated Extensions type from a struct to a map
Message: fmt.Sprintf(format, a...), | ||
Err: err, | ||
Message: fmt.Sprintf(format, a...), | ||
Extensions: make(map[string]interface{}), |
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.
Initialising Extension fields while returning a QueryError to avoid assignment to entry in nil map
error
} | ||
|
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.
updated code syntax as Extensions is update from a struct type to a map type field.
for _, loc := range err.Locations { | ||
str += fmt.Sprintf(" (line %d, column %d)", loc.Line, loc.Column) | ||
} | ||
return str | ||
} | ||
|
||
func (err *QueryError) Unwrap() error { |
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.
Unwarp() returns any underlying error if available.
maxParallelism: 10, | ||
tracer: noop.Tracer{}, | ||
logger: &log.DefaultLogger{}, | ||
panicHandler: &errors.DefaultPanicHandler{}, |
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.
initialising panicHandler to create custom panic errors that occur during query execution
maxParallelism: 10, | ||
tracer: noop.Tracer{}, | ||
logger: &log.DefaultLogger{}, | ||
panicHandler: &errors.DefaultPanicHandler{}, | ||
} | ||
for _, opt := range opts { | ||
opt(s) | ||
} | ||
|
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.
panicHandler errors.PanicHandler | ||
useStringDescriptions bool | ||
disableIntrospection bool | ||
subscribeResolverTimeout time.Duration |
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.
Added possibility to customize subscription resolver timeout value
d77614a
return &Response{Errors: []*errors.QueryError{&errors.QueryError{Message: "graphql-ws protocol header is missing"}}} | ||
return &Response{Errors: []*errors.QueryError{{Message: "graphql-ws protocol header is missing"}}} | ||
} | ||
if op.Type == query.Mutation { |
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.
Allow schema to be omitted when using default root op names 6c0f0e3
var err error | ||
t.Time, err = time.Parse(time.RFC3339, string(input)) | ||
return err | ||
case int32: | ||
t.Time = time.Unix(int64(input), 0) | ||
return nil |
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.
graphql.Time unmarshal unix nano time
@@ -31,14 +31,27 @@ func (t *Time) UnmarshalGraphQL(input interface{}) error { | |||
var err error | |||
t.Time, err = time.Parse(time.RFC3339, input) | |||
return err | |||
case int: | |||
case []byte: |
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.
expose packer.Unmarshaler interface as graphql.Unmarshaler 04aa634
@@ -0,0 +1,44 @@ | |||
package types |
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.
add types package bf0a0cc
| ------- | ------------------ | | ||
| 1.x | :white_check_mark: | | ||
| < 1.0 | :x: | | ||
|
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.
The changes were synced to this commit graph-gophers@64f8084 committed on Jul 20 2022 and the latest stable version is v1.4.0 which was released on April 11 2022 so this syncup with graphq-gophers/graphql-go is free of MaxDepth security vulnerability as this vulnerability is detected in versions <v1.3.0
@@ -0,0 +1,407 @@ | |||
#!/bin/sh |
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.
semaphore CI script
@@ -0,0 +1,166 @@ | |||
package graphql |
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.
Added Support for nullable types fced4f6
Limiter: make(chan struct{}, s.maxParallelism), | ||
Tracer: s.tracer, | ||
Logger: s.logger, | ||
PanicHandler: s.panicHandler, |
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.
Added option for custom panichandler
Tracer: s.tracer, | ||
Logger: s.logger, | ||
PanicHandler: s.panicHandler, | ||
SubscribeResolverTimeout: s.subscribeResolverTimeout, |
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.
Added possibility to customise subscription resolver timeout value
@@ -0,0 +1,24 @@ | |||
// Package noop defines a no-op tracer implementation. |
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.
Refactor Trace Package 24abfa5
@@ -0,0 +1,35 @@ | |||
# Apollo Federation |
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.
Apollo Federation Spec: Fetch service capabilities
https://github.com/graph-gophers/graphql-go/pull/507/files
With these changes, we can use graphql-go as subgraph behind Apollo Federation Gateway even though it's still not fully implements the specification, but at least it's one step closer
@@ -27,9 +27,13 @@ const Schema = ` | |||
role: Role! | |||
} | |||
|
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.
Use struct fields as resolvers instead of methods example
Last Sync-Up occurred on Sep 4, 2019. This PR is for syncing up with latest(Aug 1, 2022).
Changes
Pulled Latest Commit from graphql-go master. (Support for extensions was update)
In this PR we readded the custom change lost due to update like int64 support.
Note: We are trying to merge this PR into master since we are planning to use the latest features offered by graphql-go.
New Features and bug fixes introduces since last syncup: https://github.com/graph-gophers/graphql-go/releases