Hi -- I'm no expert, but I believe this section:
|
const xsrfToken = document.cookie.match(new RegExp('(?:^| )XSRF-TOKEN=([^;]+)')); |
|
const initialHeaders = xsrfToken ? `{ 'X-XSRF-TOKEN' : '${ xsrfToken[1] }' }` : undefined; |
...has a typo. The headers are being written as JSON, but it's using single-quotes for the key and value, whereas JSON would want double-quotes.
On my machine, in Chrome, I'm booting an app on localhost and I happened to have an XSRF Cookie set. The "headers" section loads with single-quoted JSON (which graphiql syntax-highlights as an error), and the result pane loads with this content:
{
"errors": [
{
"message": "Introspection failed. Request headers are invalid JSON: InvalidSymbol, PropertyNameExpected, InvalidSymbol, and ValueExpected."
}
]
}
Meanwhile, the schema info in the left sidebars doesn't load.
I think it all traces back to graphiql failing to query the backend on page-load due to the JSON typo.
Hi -- I'm no expert, but I believe this section:
spring-graphql/spring-graphql/src/main/resources/graphiql/index.html
Lines 57 to 58 in 7ea19a5
...has a typo. The headers are being written as JSON, but it's using single-quotes for the key and value, whereas JSON would want double-quotes.
On my machine, in Chrome, I'm booting an app on localhost and I happened to have an XSRF Cookie set. The "headers" section loads with single-quoted JSON (which graphiql syntax-highlights as an error), and the result pane loads with this content:
Meanwhile, the schema info in the left sidebars doesn't load.
I think it all traces back to graphiql failing to query the backend on page-load due to the JSON typo.