Skip to content
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

fix(GRAPHQL): Undo the breaking change and tag it as deprecated. #7607

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 11 additions & 2 deletions graphql/schema/gqlschema.go
Expand Up @@ -1737,7 +1737,7 @@ func addAggregationResultType(schema *ast.Schema, defn *ast.Definition) {
func addGetQuery(schema *ast.Schema, defn *ast.Definition, generateSubscription bool) {
hasIDField := hasID(defn)
hasXIDField := hasXID(defn)
if !hasIDField && (defn.Kind == "INTERFACE" || !hasXIDField) {
if !hasIDField && !hasXIDField {
return
}

Expand All @@ -1760,7 +1760,16 @@ func addGetQuery(schema *ast.Schema, defn *ast.Definition, generateSubscription
},
})
}
if hasXIDField && defn.Kind != "INTERFACE" {
if hasXIDField {
if defn.Kind == "INTERFACE" {
qry.Directives = append(
qry.Directives, &ast.Directive{Name: deprecatedDirective,
Arguments: ast.ArgumentList{&ast.Argument{Name: "reason",
Value: &ast.Value{Raw: "@id argument for get query on interface is being deprecated, " +
"it will be removed in v21.11.0, " +
"please update your query to not use that argument",
Kind: ast.StringValue}}}})
}
name, dtype := xidTypeFor(defn)
qry.Arguments = append(qry.Arguments, &ast.ArgumentDefinition{
Name: name,
Expand Down

This file was deleted.

This file was deleted.

Expand Up @@ -452,6 +452,7 @@ input UpdateLibraryInput {
#######################

type Query {
getLibraryItem(refID: String!): LibraryItem @deprecated(reason: "@id argument for get query on interface is being deprecated, it will be removed in v21.11.0, please update your query to not use that argument")
queryLibraryItem(filter: LibraryItemFilter, order: LibraryItemOrder, first: Int, offset: Int): [LibraryItem]
aggregateLibraryItem(filter: LibraryItemFilter): LibraryItemAggregateResult
getBook(refID: String!): Book
Expand Down