Introspection query returns a bad request
Pozoal opened this issue ยท 9 comments
Product
Banana Cake Pop
Version
18.0.0
Link to minimal reproduction
https://github.com/payroll-service-backend
Steps to reproduce
Dotnet Version 8
Hotchocolate AspNetCore 13,9.0
- Open any graphql project with banana cake pop version: 18.0.0
- Once the project starts up the schema does not load and upon inspection you should realize that the introspection query fails, thus returns code 400
What is expected?
The Introspection query is meant to return a 200
What is actually happening?
Currently this is the error we get:
{
"errors": [
{
"message": "The field isOneOf does not exist on the type __Type.",
"locations": [
{
"line": 32,
"column": 3
}
],
"path": [
"__schema",
"types"
],
"extensions": {
"type": "__Type",
"field": "isOneOf",
"responseName": "isOneOf",
"specifiedBy": "http://spec.graphql.org/October2021/#sec-Field-Selections-on-Objects-Interfaces-and-Unions-Types"
}
}
]
}
Relevant log output
{
"errors": [
{
"message": "The field isOneOf does not exist on the type __Type.",
"locations": [
{
"line": 32,
"column": 3
}
],
"path": [
"__schema",
"types"
],
"extensions": {
"type": "__Type",
"field": "isOneOf",
"responseName": "isOneOf",
"specifiedBy": "http://spec.graphql.org/October2021/#sec-Field-Selections-on-Objects-Interfaces-and-Unions-Types"
}
}
]
}
Additional context
No response
Started running into this a few hours ago in BananaCakePop (as soon as the banner for upgrading to Nitro appeared). We've had no code changes deployed in the past 24 hours.
I think there might be an issue with the new introspection query.
We have worked around this by specifying the URL to our schema in the SDL Schema Endpoint
field which bypasses introspection.
We have the same issue. We didn't update anything.
It sounds like it could be a very critical and urgent issue for quite a few people using that Nitro / ChilliCream.
The issue is using the
var conf = services
.AddGraphQLServer()
.ModifyOptions(o => o.EnableOneOf = true)
in combination to
public class FieldValueUpdateType : InputObjectType<FieldValueUpdate>
{
protected override void Configure(IInputObjectTypeDescriptor<FieldValueUpdate> descriptor)
{
descriptor
.OneOf();
If I remove the one of parts, Nitro will start work again.
Issue also exists in HC 13.9.14
We are looking into it.
We found the bug. We will issue new Hot Chocolate versions for 12, 13 and 14 today.
We found the bug. We will issue new Hot Chocolate versions for 12, 13 and 14 today.
Thank you @michaelstaib
This one is now fixed.
@michaelstaib But I don't see a new release? Does the package at runtime get resources from a cdn, where the issue was.
OMG: Just ran the tool, did a CTRL-F5 no dice. Then posted an update to this comment, thought, let's try one more time, and now it works :-( But this does confirm that online resources are read by the package that could impact a stable production release, that feels wrong
@jbennink yes, by default nitro (former BCP) is pulled in from a CDN. In 6 years its the first time that we broke a small percentage of users. Basically only if you are using an alpha feature of the GraphQL spec. In my opinion this is a great setting as you get the newest tooling without a hassle.
However, you can pin the version that you are using like the following:
app.MapGraphQL().WithOptions(
new GraphQLServerOptions
{
Tool = {
ServeMode = GraphQLToolServeMode.Version("18.0.0")
}
});
You can also pin it to the latest insider or prod version
app.MapGraphQL().WithOptions(
new GraphQLServerOptions
{
Tool = {
ServeMode = GraphQLToolServeMode.Insider
}
});
For environments where you do not want things to come from a CDN you can also pin it to the embedded version.
app.MapGraphQL().WithOptions(
new GraphQLServerOptions
{
Tool = {
ServeMode = GraphQLToolServeMode.Embedded
}
});