running a graphql mutation & query at the same time, via postman, or in general?

423 Views Asked by At

I'm trying to extract some metadata reliably from graphql requests from my loggigng module, but to do this I'm trying to test some more advanced scenarios.

I've tried a lot of variations of the following, some of them with the help of chatGPT (which was hilariously useless):


mutation signup{
    sign1: signUp  (SignUpInput: {name: "potato"}) {
        id
        email
        phone
        createdAt
    }

        sign2: signUp  (SignUpInput: {name: "potato"}) {
        id
        email
        phone
        createdAt
    }
}

 query health{
    health: userGraphHealth 
}

unfortunately I keep getting Must provide operation name if query contains multiple operations. error.

Is it not possible/not a pattern at all, to run mutations and queries in the same document/operation?

Or is this simply a postman limitation?

EDIT: I have re-added the postman tag because this is a caveat around how postman works with graphql.

0

There are 0 best solutions below