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

cherry-pick v20.07: docs: add info about __typename in custom DQL (#6248) #6273

Merged
merged 1 commit into from
Aug 31, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions wiki/content/graphql/custom/graphqlpm.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,12 @@ query {
```

There are following points to note while specifying the DQL query for such custom resolvers:

* The name of the DQL query that you want to map to the GraphQL response, should be same as the name of the GraphQL query.
* You must use proper aliases inside DQL queries to map them to the GraphQL response.
* If you are using variables in DQL queries, their names should be same as the name of the arguments for the GrapqhQL query.
* For variables, only scalar GraphQL arguments like Boolean, Int, Float etc are allowed. Lists and Object types are not allowed to be used as variables with DQL queries.
* You would be able to query only those many levels with GraphQL which you have mapped with the DQL query. For instance, in the first custom query above, we haven't mapped an author's tweets to GraphQL alias, so, we won't be able to fetch author's tweets using that query.
* If the custom GraphQL query returns an interface, and you want to use `__typename` in GraphQL query, then you should add `dgraph.type` as a field in DQL query without any alias. This is not required for types, only for interfaces.

---