GraphQL support for nodes and edges
Hi @Omer I am trying to use Elide's GraphQL API and trying to use refine-graphql. Elide returns data inside edges and node format.
How can I achieve this with Refine?
8 Replies
Hi @.dark.energy. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
flat-fuchsia•14mo ago
I am trying to use Elide's GraphQL API and trying to use refine-graphql. Elide returns data inside edges and node format.
{
"data": {
"group": {
"edges": [
{
"node": {
"commonName": "Example Repository",
"description": "The code for this project",
"name": "com.example.repository"
}
}
]
}
}
}
How can I achieve this with Refine?
Sorry @.dark.energy, I seem to be having a bit of trouble. Don't worry though, I've pinged my supprt and they will try to fix me up! :technologist:
Perhaps try again in 15mins?
Hey @salihozdemir ,
Can you help @.dark.energy ?
flat-fuchsia•14mo ago
Hey @.dark.energy,
If you sure that the data will always be in the same format, you can implement a return type in your dataProvider like this:
flat-fuchsia•14mo ago
Thanks @salihozdemir that's the transformation part but I need to modify the query before it gets sent
Adding edges and nodes to the fieldset
Any update?
flat-fuchsia•14mo ago
We'll use
gql-query-builder
to build the graphQL query. It provides flexible API to build the query. You can find the documentation here:
https://github.com/atulmy/gql-query-builder
Also, you can checkout our hasura
and strapi-graphql
data provider to see how we are using it.flat-fuchsia•14mo ago
Thanks I was able to achieve it reading the strapi graphql implementation
Alternatively, implement your own graphql query adapter