-
Notifications
You must be signed in to change notification settings - Fork 145
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
Variables missing in requests in GraphQL explorer #527
Comments
Finally get it working by editing two files.
// Defines a GraphQL fetcher using the fetch API.
function graphQLFetcher(graphQLParams) {
console.log(graphQLParams);
return fetch(window.location.origin + '/api/graphql', { <-------------
method: 'post',
headers: {
'Content-Type': 'application/graphql',
'apikey': 'graphiql'
},
body: JSON.stringify(graphQLParams) // <-------------
}).then(function (response) {
return response.text();
}).then(function (responseBody) {
console.log(responseBody);
try {
return JSON.parse(responseBody);
} catch (error) {
return responseBody;
}
});
}
(defn execute-request [query]
(let [{:keys [query variables operationName]} (json/read-str query :key-fn keyword)]
(-> (lacinia/execute compiled-schema query variables nil)
(json/write-str)))) |
Ah, thanks for digging into this. I'll update the template with the fixes. |
I've updated the template here, if that works I think we can close the issue. |
Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The sample project is created with the command
lein new luminus luminus-sample +aleph +postgres +graphql +swagger +auth +auth-jwe
.In the GraphQL explorer window (
http://localhost:3000/graphiql
), with the following queryand the variable,
The request body sent to the server only has the query, missing the variables,
The text was updated successfully, but these errors were encountered: