-
Notifications
You must be signed in to change notification settings - Fork 24
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
return empty response when subscription are running on the internal introspection service #649
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: "top level field is removed for a subscription with namespaced field" | ||
enabled: true | ||
# language=GraphQL | ||
overallSchema: | ||
CommentService: | | ||
directive @toBeDeleted on FIELD_DEFINITION | ||
type Query { | ||
commentById(id: ID): Comment @toBeDeleted | ||
} | ||
type Subscription { | ||
commentsApi: CommentsApi @namespaced | ||
} | ||
type CommentsApi { | ||
onCommentUpdated(id: ID): Comment @toBeDeleted | ||
} | ||
type Comment { | ||
id: ID | ||
} | ||
# language=GraphQL | ||
underlyingSchema: | ||
CommentService: | | ||
type Query { | ||
commentById(id: ID): Comment | ||
} | ||
type Subscription { | ||
commentsApi: CommentsApi | ||
} | ||
type CommentsApi { | ||
onCommentUpdated(id: ID): Comment | ||
} | ||
type Comment { | ||
id: ID | ||
} | ||
# language=GraphQL | ||
query: | | ||
subscription { | ||
commentsApi { | ||
onCommentUpdated(id: "C1") { | ||
id | ||
} | ||
} | ||
} | ||
variables: { } | ||
serviceCalls: [ ] | ||
# language=JSON | ||
response: |- | ||
{ | ||
"errors": [ | ||
{ | ||
"locations": [], | ||
"message": "null", | ||
"extensions": { | ||
"classification": "ValidationError" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this error is coming from a "remove field" transform that we use for tests. I activated this transform with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. previously we would blow up with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So this is an error from the introspection service? Why is the error message null? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nah, this error is coming from the transform, look at this comment https://github.com/atlassian-labs/nadel/pull/649/files/5774cd1580b7dcaeaecb6b6b7d46bdea52b078eb#r1870548215 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I clarified the error message on the RemoveFieldTransform to make it less confusing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah I see |
||
} | ||
} | ||
], | ||
"data": { | ||
"commentsApi": null | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: "top level field is removed for a subscription" | ||
enabled: true | ||
# language=GraphQL | ||
overallSchema: | ||
CommentService: | | ||
directive @toBeDeleted on FIELD_DEFINITION | ||
type Query { | ||
commentById(id: ID): Comment | ||
} | ||
type Subscription { | ||
onCommentUpdated(id: ID): Comment @toBeDeleted | ||
} | ||
type Comment { | ||
id: ID | ||
} | ||
# language=GraphQL | ||
underlyingSchema: | ||
CommentService: | | ||
type Query { | ||
commentById(id: ID): Comment | ||
} | ||
type Subscription { | ||
onCommentUpdated(id: ID): Comment | ||
} | ||
type Comment { | ||
id: ID | ||
} | ||
# language=GraphQL | ||
query: | | ||
subscription { | ||
onCommentUpdated(id: "C1") { | ||
id | ||
} | ||
} | ||
variables: { } | ||
serviceCalls: [ ] | ||
# language=JSON | ||
response: |- | ||
{ | ||
"errors": [ | ||
{ | ||
"locations": [], | ||
"message": "null", | ||
"extensions": { | ||
"classification": "ValidationError" | ||
} | ||
} | ||
], | ||
"data": { | ||
"onCommentUpdated": null | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: "no introspections on subscriptions" | ||
enabled: true | ||
# language=GraphQL | ||
overallSchema: | ||
MyService: | | ||
type Query { | ||
comment: Comment | ||
} | ||
type Subscription { | ||
onComment: Comment @namespaced | ||
} | ||
type Comment { | ||
id: ID | ||
} | ||
# language=GraphQL | ||
underlyingSchema: | ||
MyService: | | ||
type Query { | ||
comment: Comment | ||
} | ||
type Subscription { | ||
onComment: Comment | ||
} | ||
type Comment { | ||
id: ID | ||
} | ||
# language=GraphQL | ||
query: | | ||
subscription { | ||
__typename | ||
} | ||
variables: { } | ||
serviceCalls: [ ] | ||
# language=JSON | ||
response: |- | ||
{ | ||
"data": null, | ||
"errors": [ | ||
{ | ||
"message": "Validation error (SubscriptionIntrospectionRootField) : Subscription operation 'null' root field '__typename' cannot be an introspection field", | ||
"locations": [ | ||
{ | ||
"line": 2, | ||
"column": 3 | ||
} | ||
], | ||
"extensions": { | ||
"classification": "ValidationError" | ||
} | ||
} | ||
] | ||
} |
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.
So just empty result?