Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore types coming from super graph #1904

Open
gituserjava opened this issue Sep 29, 2023 · 5 comments
Open

Ignore types coming from super graph #1904

gituserjava opened this issue Sep 29, 2023 · 5 comments

Comments

@gituserjava
Copy link

We use super graph and some types and inputs may not be available in the current Graph QL schema that we are validating however we will be extending from type defined in super graph as shown in example below, in such a case how can I avoid below two errors? I want to still apply other rules around naming convention, field descriptions etc on the types defined in sub graph. Please advise.

Example:
Super graph

type Product {

id: String;

}

Sub Graph

extend type Product{
productName: String
}

Errors:
Unknown type "Product". Did you mean "Product"?
Cannot extend type "Product" because it is not defined.

@dimaMachina
Copy link
Collaborator

you can use eslint-ignore directive comments for example

@gituserjava
Copy link
Author

No this did not work for me, what is the syntax to use in Graph ql schema files? I am trying as below, please advise.

# eslint-ignore

extend type Product{
productName: String
}

@dimaMachina
Copy link
Collaborator

Same as in eslint :
# eslint-disable-next-line

@gituserjava
Copy link
Author

No this did not work and I believe it is because the graph ql schema is trying to find the parent schema to prepare the consolidated schema. Is there a workaround for this?

Cannot extend type "Product" because it is not defined.

@gituserjava
Copy link
Author

@B2o5T, any work around for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants