Open k1ng440 opened 1 year ago
We are going to look to add direct capability in the future. For now, I wanted to document the work around that @mathnogueira shared in Discord in case others hit the same issue. If you are reading this with the same issue - leave a note as it will help us prioritize the work!
Here are the notes Matheus shared:
You would only need to send a POST request to your graphql endpoint with the following body:
{ "query": "query{...}" }
replace query{...} with your actual query
For example, I tested it with this graphql example API (https://hub.docker.com/r/favware/graphql-pokemon).
I managed to trigger it with this test:
type: Test spec: name: List pokemon description: List pokemon with GraphQL trigger: type: http httpRequest: method: POST url: http://graphql:4000 body: "{\n \"query\": \"query Query($take: Int, $offset: Int) {getAllPokemon(take: $take, offset: $offset) { color height species } }\",\n \"variables\": {\"take\": 1, \"offset\": 0}\n}" headers: - key: Content-Type value: application/json
Older issue.... but I wanted to mention that we have now added a graphQL trigger to the commercial version of Tracetest. You can read about it here! https://tracetest.io/blog/trace-based-tests-with-graphql-in-action
Is your feature request related to a problem? Please describe. Right now we have to write multiple lines into a single line using a newline delimiter (
\n
) in query and it's not convenient to write and maintain themDescribe the solution you'd like Graphql client with introspection support would be nice.