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

feat(variables): take consideration of nested variables #55

Merged
merged 3 commits into from
Dec 20, 2020
Merged

feat(variables): take consideration of nested variables #55

merged 3 commits into from
Dec 20, 2020

Conversation

clement-berard
Copy link
Contributor

Hello community!

Nested fields have served me well. Nevertheless, the variables for the sub-operations were not added to the variables of the query (only the first sub-operation).

So I propose a small modification to collect all the variables, no matter how deep they are.

Below, the result of the query added in test.

query(
  $id: ID
  $visible: Boolean
  $platformLimit: Int
  $idChannel: Int!
  $channelLimit: Int
  $rightsLimit: Int
  $rightsOffset: Int
  $userLimit: Int
  $userFilter: String
) {
  getPublicationNames {
    publication(id: $id) {
      id
      name
      platforms(visible: $visible, limit: $platformLimit) {
        totalCount
        edges {
          label
          code
          parentId
          id
          rights(
            idChannel: $idChannel
            limit: $rightsLimit
            offset: $rightsOffset
          ) {
            id
            label
            users(limit: $userLimit, filters: $userFilter) {
              id
              name
            }
          }
        }
        subField
        channels(id: $idChannel, limit: $channelLimit) {
          id
          label
        }
      }
    }
  }
}

thanks to all of you :)

@atulmy
Copy link
Owner

atulmy commented Dec 20, 2020

Thanks for the contribution @clement-berard!

@atulmy atulmy merged commit 510b855 into atulmy:master Dec 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants