I try to understand Graphql in django and use graphene
and graphene_django
.
My frontend will probably be built with Vuejs and Apollo client.
All the tutorials on the internet are about wether classic Graphql or Relay.
Relay with its Nodes and Edges seem to be advised (is it ?).
But Node and Edges are available with wether the interface graphene.Node
or the interface graphene.relay.Node
.
Is there any difference between these two ?
Complementary question : Is it a good practice to use node and edges, even though I wont use Relay/React ? Apollo docs are all about classic Graphql.
Regards
As Yang HG pointed out, there is no difference between relay.Node and Node.
Whether it's a good practice to use the Node interface, the best thing about it is it forces the types that inherit Node to have an ID. Second advantage: Connection (adding extra fields to the node's Connection and Edge).
Read this to see how ID is enforced for all Nodes: https://atheros.ai/blog/graphql-interfaces-and-unions-how-to-design-graphql-schema
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With