I am wondering if this could be done now with a custom field dql that calls a custom query which calls custom DQL instead of custom http. I would think custom fields would support custom dql, but there are no examples in the docs…
type User {
username
followings_count: Int @custom(http: {
url: "https://YOUR DGRAPH ENDPOINT/graphql",
method: GET,
graphql: "query { getFollingCount(username) { ..."
})
...
}
Type Query {
getFollowingCount(username: String!): Int @custom(dql: """
...custom DQL...
)
}
Seems like a hack, a slow one, but I think this could work for now.
Again, I would think a custom field would support DQL and HTTP.
Your example is still a Custom Query, not a Custom Field.
What I am wondering is if you could run a custom dql query inside a custom field. It looks like custom fields only support http and not dql.
So, my hack is to run a custom field http that calls the custom query.
So, in your example, you would have:
type User {
screen_name: String! @id
followers: Int @search
tweet_count: Int @custom(http: {
url: "https://YOUR DGRAPH ENDPOINT/graphql",
method: GET,
graphql: "query { queryUserTweetCounts(User) { ..."
})
...
}
Which would indirectly call you queryUserTweetCounts custom query from a custom field. Obviously this would require a whole server jump that is unnecessary, but it does make it possible.