Anyone called a GraphQL API with bubble?

Hey, I struggled quite a lot on that case and I think I can now help.

Here are the steps to follow when using GraphQL API with Bubble’s API Connector:

1. Use the playground of the GraphQL API to find the correct query you’re looking for

2. Click on COPY CURL at the top right

3. It should copy this kind of code:
curl 'https://api.sorare.com/graphql' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Origin: https://api.sorare.com' --data-binary '{"query":"query {\n user(slug: \"ntfc\") {\n cardCounts{total}\n id\n nickname\n profile {\n pictureUrl\n }\n slug\n paginatedCards(rarities: [limited, rare, super_rare, unique]) {\n nodes {\n name\n age\n position\n rarity\n pictureUrl\n }\n }\n }\n}\n"}' --compressed

4. Go to the API Connector and configure an API Call of POST type. Add required headers of the call. Then, paste into the Body the part of the previous code starting with {"query and ending with "}


Special thanks to @arnaud.ledoeuff22 for the help!

10 Likes