API Playground multiple operations error

When using the API Playground GraphiQL interface, it seems like it supports the ability (like the default GraphiQL from Apollo) to have multiple queries in the editor, then choose which one to run. It doesn’t work though and gives the error "An operation name is required" even though I have specified operation names for each query/mutation.

1 Like

Hey @jimcullison,

I was able to recreate this on my end. Let me check in with the team on this one and I’ll get back with an update.

-Danny

1 Like

Hey @jimcullison,

I was able to check in with the team on this one - unfortunately right now the API Playground only supports one query at a time. I can totally understand how having multiple queries would be useful, and how it can be even more confusing given it seems to give you the option to do so (it confused me as well, which is why I went to check in with the team).

What I’ve done is gone ahead and passed along both items as feedback to the team and added it to our roadmap: supporting multiple queries, and cleaning up that dialog / message in the meanwhile. I can’t promise an ETA on this, but it’s something we’ll look into our end.

-Danny

Thanks for checking :slight_smile:

For others who come across this issue, it’s not restricted to the API Playground. The error

“An operation name is required”

also happens when creating a traditional HTTP POST even when providing an operation name for each query/mutation/subscription and also adding an "operationName" element to the HTTP body for the specific operation to execute.

E.g. this request body will return the error:

{"query": "
        mutation updateA {
            change_multiple_column_values (
                board_id: 1060033123, 
                item_id: 1050033123, 
                column_values: "{\"numbers\": \"300309.21\"}"
                )
                    {
                        id
                    }
       }
    
        mutation updateB {
            change_multiple_column_values (
                board_id: 1060033123, 
                item_id: 1050033456, 
                column_values: "{\"numbers\": \"61512.14\"}"
                )
                    {
                        id
                    }
       }
    ", "operationName": "updateA"}

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.