hasura / hasura/graphql-engine

Similarly named types in different namespaces appear in namespace they're not supposed to

Open
#9,958 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

k/bug
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

Version Information

Server Version: v2.34.0

Environment

OSS

What is the current behaviour?

I have two remote schemas. Both remote schemas point to GraphQL endpoints of separate stacks we have on Contentstack.

1. cs-ikhlas-package

Type names are prefixed with Travel and namespace is package

2. cs-ikhlas-umrah

Type names are prefixed with Umrah and namespace is umrah

In both package and umrah, we have types named all_customer_manage_my_booking_page. One of the key differences between package's all_customer_manage_my_booking_page and umrah's all_customer_manage_my_booking_page is package's has a package_type field whilst umrah's does not have a package_type field.

In the remote schema preview on Hasura, I can see that the types are being shown accurately. However, they are wrong in Hasura's GraphQL schema.

When I remove umrah remote schema; correct Screenshot 2023-10-27 at 11 37 01 AM
When I have both package and umrah remote schemas; incorrect Screenshot 2023-10-27 at 10 20 57 AM
What is the expected behaviour?

Type for all_customer_manage_my_booking_page in package namespace should be TravelAllCustomerManageMyBookingPage and not UmrahAllCustomerManageMyBookingPage.

How to reproduce the issue?
  1. In two separate stacks on Contentstack, create types with same name but without having the same fields
  2. Add GraphQL endpoints of both stacks as remote schemas in Hasura
  3. Check explorer on Hasura whether the typing for the all_ types are accurate
Screenshots or Screencast

Shared above.

Please provide any traces or logs that could help here.

None of any relevance.

Any possible solutions/workarounds you're aware of?

None.

Keywords

remote schema, namespace

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with two Contentstack GraphQL endpoints configured as remote schemas, using the reported duplicate all_customer_manage_my_booking_page type and differing fields. Compare the remote schema previews with Hasura's generated GraphQL schema; done means each namespace resolves the type to its corresponding Travel or Umrah definition.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.