hi folks,
I am using the bubble api plugin to do post GraphQL call. however it returns an error, “message”: “No query string was present”. how to I attachh a the script? which data type do I need to set?
hi folks,
I am using the bubble api plugin to do post GraphQL call. however it returns an error, “message”: “No query string was present”. how to I attachh a the script? which data type do I need to set?
This may be helpful. It’s directly from the graphql website. Looks like it goes in the payload body
Your GraphQL HTTP server should handle the HTTP GET and POST methods.
When receiving an HTTP GET request, the GraphQL query should be specified in the “query” query string. For example, if we wanted to execute the following GraphQL query:
{
me {
name
}
}
This request could be sent via an HTTP GET like so:
http://myapi/graphql?query={me{name}}
Query variables can be sent as a JSON-encoded string in an additional query parameter called variables
. If the query contains several named operations, an operationName
query parameter can be used to control which one should be executed.
A standard GraphQL POST request should use the application/json
content type, and include a JSON-encoded body of the following form:
{
"query": "...",
"operationName": "...",
"variables": { "myVariable": "someValue", ... }
}
operationName
and variables
are optional fields. operationName
is only required if multiple operations are present in the query.
In addition to the above, we recommend supporting two additional cases:
If you’re using express-graphql, you already get these behaviors for free.
Hi Jared, first of all thank for helping. i will check your solution. thanks again
Hi Jared,
i tried get approach, worked great. thanks a lot!
thanks a lot
Magnus
This topic was automatically closed after 70 days. New replies are no longer allowed.