lablup / lablup/backend.ai

Implement Node resolver in relay support node GQL types

Open
#5,980 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
670
Forks
183
Avg merge
17h 7m
Merged PRs (30d)
358

Description

## Motivation

According to relay spec, GraphQL types implementing the Node interface must provide a root field named node, enabling clients to query nodes via their global ID(ref: [https://graphql.org/learn/global-object-identification/](https://graphql.org/learn/global-object-identification/) ). However, some types currently implementing the Node interface do not provide this field.

For types currently written in Graphene, this can be achieved by implementing the `get_node` function(ref: [https://docs.graphene-python.org/en/latest/relay/nodes/](https://docs.graphene-python.org/en/latest/relay/nodes/) ). Types with `get_node` implemented must be examined and this method must be implemented.

For types written in Strawberry, this can be achieved by implementing `resolve_nodes` method(ref: [https://strawberry.rocks/docs/guides/relay#relay-guide](https://strawberry.rocks/docs/guides/relay#relay-guide))

## Objective

Ensure full compliance with the GraphQL Relay specification by implementing the required `get_node` , `resolve_nodes` method for all types that implement the Node interface. This will enable proper global object identification functionality, allowing clients to query any node using the standardized `node(id: ID!)` root field.

JIRA Issue: BA-2455

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.