1

I am wanting to fetch queries for custom fields of users, how would I go about doing that?

So if I did something like this:

query {
users {
        id
    firstName
    lastName
    email
    photo {
      id
    }       
}

}

How would I get the custom fields I created for users?

1 Answer 1

2

Users query will return a list of UserInterface objects (docs) so you will need to do something like this:

query {
  users {
    ... on User {
      firstName
      lastName
      email
      photo {
        id
      }
      yourCustomField
      yourOtherCustomField
    }
  }
}
1
  • Thank you this is perfect. Mar 4, 2022 at 0:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.