v0.5.0
版本发布时间: 2017-01-28 08:07:07
graphql-go/graphql最新发布版本:v0.8.1(2023-04-11 02:20:23)
This release brings up graphql-go
on par with graphql-js v0.5.0
and fully compliant with April 2016 spec.
Note: This release was retroactively added.
Notable changes:
- https://github.com/graphql-go/graphql/pull/123/commits/58f2928b94007b502f882eee4a9a1f82dd118603 [RFC] Proposed change to directive location introspection
-
https://github.com/graphql-go/graphql/pull/123/commits/2322d258313c9307a838ae7fe1d19e70f57937a1 [RFC] Directives in schema language
- ❗️Breaking Changes:
graphql.NewDirective(*graphql.Directive)
=>graphql.NewDirective(graphql.DirectiveConfig)
- Affects those that defined custom directives.
- ❗️Breaking Changes:
-
https://github.com/graphql-go/graphql/pull/123/commits/03b92b0230f165ff27078db28aceea8c1cbc2432 Move getTypeOf to execute.js and rename to defaultResolveTypeFn to mirror defaultResolveFn
- ❗️Breaking Changes: removed
ObjectType(interface{}, ResolveInfo) *Object
fromAbstract
interface,Union
andInterface
structs and moved toexecutor
- Affects those that directly retrieved the
ObjectType
of anAbstract
type (Union
/Interface
)
- ❗️Breaking Changes: removed
-
https://github.com/graphql-go/graphql/pull/123/commits/79f48da704036914912ccfbf60e1aba6d5714ad1 Add GraphQLSchema types field
- ❗️Breaking Changes:
- This introduces a breaking change to the Type System API. Now, any individual Interface type does not have the required information to answer
GetPossibleTypes
orIsPossibleType
without knowing the other types in the Schema. These methods were moved to the Schema API, accepting the abstract type as the first parameter. - This also introduces a breaking change to the type comparator functions:
IsTypeSubTypeOf
andDoTypesOverlap
which now require a Schema as a first argument.
-
https://github.com/graphql-go/graphql/pull/123/commits/1e33c35ba9684a3ca02bf0de8b24688636cd3295 [RFC] Add explicit context arg to graphql execution
- ❗️Breaking Changes
- Removed
Schema
fromResolveParams
, already available inResolveParams.Info
-
IsTypeOfFn
andResolveTypeFn
params are now struct, similar toFieldResolveFn
-
context
is now available for resolving types inIsTypeOfFn
andResolveTypeFn
, similar toFieldResolveFn
- https://github.com/graphql-go/graphql/pull/123/commits/a241e1cac73928a834a7691328c283e413b41661 RFC: Return type overlap validation
- https://github.com/graphql-go/graphql/pull/123/commits/e23ac77f2b1e34dfeff02469edca600cb54a3b7e Add Schema Definition to IDL.
Changes to public/exported vars / func
Previous | New | Risk |
---|---|---|
graphql.NewDirective(*graphql.Directive) |
graphql.NewDirective(graphql.DirectiveConfig) |
Low-Medium |
graphql.Abstract.ObjectType(interface{}, ResolveInfo) *Object |
removed |
Low-Medium |
graphql.Union.ObjectType(interface{}, ResolveInfo) *Object |
removed |
Low-Medium |
graphql.Interface.ObjectType(interface{}, ResolveInfo) *Object |
removed |
Low-Medium |
graphql.IsTypeOfFn(interface{}, ResolveInfo) |
graphql.IsTypeOfFn(IsTypeOfParams) |
High |
graphql.ResolveTypeFn(interface{}, ResolveInfo) |
graphql.ResolveTypeFn(ResolveTypeParams) |
High |
graphql.ResolveParams.Schema |
removed , already available in graphql.ResolveInfo |
Low-Medium |