Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

I am trying to fetch findSpaces using GraphQL i didn't get corresponding response from GraphQL

Ravi Prasad November 21, 2023

Endpoint: https://mysite.atlassian.net/gateway/api/graphql

query{
confluence {
findSpaces(cloudId: "my-cloud-id) {
edges {
node {
id
name
}
}
}
}

I am getting Error: {
"errors": [
{
"message": "You MUST provide a 'X-ExperimentalApi : confluence-agg-beta' HTTP header to use the field 'findSpaces' (confluence/findSpaces)",
"extensions": {
"statusCode": 400,
"errorSource": "GRAPHQL_GATEWAY",
"classification": "ExecutionAborted"
}
},
{
"message": "Warning : You MUST provide a query operation name. In the future operations without names will be banned.",
"extensions": {
"statusCode": 400,
"errorSource": "GRAPHQL_GATEWAY",
"classification": "ExecutionAborted"
}
}
],
"data": null,
"extensions": {
"gateway": {
"request_id": "65dac168fdba4a00b87caaf0ac1e7b81",
"crossRegion": false,
"edgeCrossRegion": false,
"deprecatedFieldsUsed": []
}
}
}

2 answers

1 accepted

0 votes
Answer accepted
Ravi Prasad November 22, 2023

How to I get all pages information in a Space, I need page tree structure in a Space. Also I am not able to get blogpost ID in findSPace, Space and spaces in the GraphQL methods. Could please help on this issue. 

0 votes
Felipe
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 22, 2023

Hi @Ravi Prasad . You have 2 errors you need to deal with.

 

1. You MUST provide a query operation name

You need to provide an operation name on your query document. An operation name is an arbitrary text that declares the purpose of your query.

query your_operation_name {
confluence {
findSpaces(cloudId: "my-cloud-id") {
edges {
node {
id
name
}
}
}
}

 

2. You MUST provide a 'X-ExperimentalApi : confluence-agg-beta' HTTP header to use the field 'findSpaces' (confluence/findSpaces)

You'll get this kind of error when your query contains fields that are in the Beta release stage. 

You have to explicitly opt in to use beta fields, and you do so via adding the  X-ExperimentalApi header with findSpaces as a value. You can add multiple values separated by comma too.

This is how the whole request would look like in GraphiQL

Monosnap GraphQL Gateway 2023-11-23 14-01-47.png

Ravi Prasad November 22, 2023

Thank you @Felipe 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events