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

[Bug] Missing fields from generated collection. #24

Closed
JamesPeters98 opened this issue May 25, 2021 · 2 comments
Closed

[Bug] Missing fields from generated collection. #24

JamesPeters98 opened this issue May 25, 2021 · 2 comments

Comments

@JamesPeters98
Copy link

I currently have a workflow that generates a GraphQL schema and then uses Postman to generate a collection to test our API.

I've come across an issue where certain nested fields don't get included in the generated collection. I have a reproducible schema below:

schema {
  query: Query
}

"Query root"
type Query {
  testQuery(
    parameter: String
  ): RootType
}

type RootType {
  elements: [ArrayElement]
}

type ArrayElement {
  a: NestedElement
  b: NestedElement
  c: NestedElement
}

type NestedElement {
  element: Element
}

type Element {
  text: String
  subElement: SubElement
  name: String
}

type SubElement {
  code: String
  text: String
  moreText: String
} 

This produces an incorrect query in the collection that looks like this:

query testQuery ($parameter: String) {
    testQuery (parameter: $parameter) {
        elements {
            a {
                element {
                    text
                    subElement {
                        code
                        text
                        moreText
                    }
                    name
                }
            }
            b {
                element {
                    text
                    name
                }
            }
            c {
                element {
                    text
                    name
                }
            }
        }
    }
}

Where elements b and c are missing the subElement. It is always the first element that has the subElement and the remaining elements are missing it.

@umeshp7
Copy link
Contributor

umeshp7 commented Sep 27, 2021

@JamesPeters98 Thanks for reporting this.
I have released a new version with this fix. It will be in the postman app soon. :)

@JamesPeters98
Copy link
Author

@umeshp7 Thanks, seems to have fixed the issue 👍

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

No branches or pull requests

2 participants