Skip to content
This repository was archived by the owner on Sep 27, 2023. It is now read-only.
This repository was archived by the owner on Sep 27, 2023. It is now read-only.

Generated refetch definition with variables can not pass the validation of backend, such as github.com/vektah/gqlparser/v2 #259

Open
@bonafideyan

Description

@bonafideyan

for example, a query which has a variable that is required contains a refetchable fragment, relay permit does not provide the variable for refetch, (it still provide value of the variable in last query), so the refetch definition write the variable as is NOT required.

query  mainQuery($var: Boolean!) {
    ...mainFragment   @relay(mask: true)
}

fragment mainFragment on Query @refetchable(queryName: "MainFragmentQuery") {
    something @include(if: $var)
}

and generated refetch definition:

query MainFragmentQuery(
  **$var: Boolean**
) {
  ...mainFragment
}

but that can not pass the validation of backend, such as github.com/vektah/gqlparser/v2, because it think the $var should be required when it see $var is used in @include.

I have no idea how to solve this problem, or where do I make mistake?

thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions