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] Empty phone present when querying #144

Open
ryanrightmer opened this issue Feb 11, 2021 · 2 comments · Fixed by #151
Open

[Bug] Empty phone present when querying #144

ryanrightmer opened this issue Feb 11, 2021 · 2 comments · Fixed by #151
Labels
bug Something isn't working

Comments

@ryanrightmer
Copy link
Collaborator

The query

query {
  tenants {
    edges {
      node {
        phones {
          phoneNumber
        }
      }
    }
  }
}

Shows that there is an empty object in the phones array, instead of an empty array. This is breaking the tenants.

@ryanrightmer ryanrightmer added the bug Something isn't working label Feb 11, 2021
@JamesBock
Copy link
Collaborator

I'm not exactly sure what the problem is. There are ways of getting the data though. Just exclude the edges. Admittedly, edges are probably the thing that I understand least about gql. I'll do some digging but for now...

query {
  tenants {
    nodes {
      name
      phones {
        phoneNumber
      }
      residence {
        address {
          city
        }
      }
    }
  }
}

returns this:


  "data": {
    "tenants": {
      "nodes": [
        {
          "name": "Testy Testerson",
          "phones": [
            {
              "phoneNumber": "2817848004"
            }
          ],
          "residence": null
        },
        {
          "name": "James Bock",
          "phones": [
            {
              "phoneNumber": "2817846565"
            }
          ],
          "residence": null
        },
        {
          "name": "John Hollis",
          "phones": [
            {
              "phoneNumber": "4128881222"
            }
          ],
          "residence": null
        }
      ]
    }
  }
}

@rixong
Copy link
Collaborator

rixong commented Feb 11, 2021

This was the query that was causing a problem:

query {
    tenant (id: "VGVuYW50Cmkx") {
        name
        id
        residenceId
        phones {
          phoneNumber
        }
    }
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants