Fetching Many Users from a Specific Location


#1

Hi there,
I am new to GraphQL and API’s in general. I am trying to fetch many users in a certain location and then data for each of the returned users. I would like to filter location using a variable if possible.

My current query is as follows:

 {
search(query: "type:user", first: 20, type: USER ) {
userCount
edges {
  node {
    ... on User {
      	login
      	name
      	location
      	bio
      	isEmployee
      	avatarUrl(size: 100)
     	 	email
     	 	url
    }
   }
  }
 }
}

I would really appreciate it if someone could share their solution with me or give me a nudge it the right direction.

Thanks,
Matthew


#2

Hi Matthew,

Does adding ‘location’ in the query work for you ?

{
  search(query: "type:user location:berlin", first: 20, type: USER) {
    userCount
    edges {
      node {
        ... on User {
          login
          name
          location
          bio
          isEmployee
          avatarUrl(size: 100)
          email
          url
        }
      }
    }
  }
}