GraphQL: directive for GraphQL+- custom resolver (e.g Geolocation)

At the moment, support for scalars inside body is not there in master. So, directly specifying the query string inside body won’t work for now. We will be adding support for scalars soon. In the meantime, you will need to send even the query as a variable like:

type Query{
    getGeo(name: String!, query: String!): GeoObject @custom(http:{
        url: "https://localhost:8080/query"
        method: "POST",
        body: "{ query: $query, variables: {$name: $name}}"
    })
}

Where the value of $query will be: “query q($name: string) { q(func: eq(name, $name)) { uid name } }”

Update: @machship-mm We have decided to work on adding Geo types in GraphQL too. Hope to have it out soon.

2 Likes