dgraph-docs icon indicating copy to clipboard operation
dgraph-docs copied to clipboard

Custom resolvers (custom query) page says all custom queries use HTTP

Open damonfeldman opened this issue 2 years ago • 1 comments

This page: https://dgraph.io/docs/graphql/custom/custom-overview/ states that "Dgraph doesn’t execute your custom logic itself. It makes external HTTP requests" but I believe the more performant approach is to use DQL extensions which are executed within the Dgraph process.

I suggest

_"Dgraph creates a GraphQL API from nothing more than GraphQL types. That’s great, and gets you moving fast from an idea to a running app. However, at some point, as your app develops, you might want to customize the behavior to perform more general query logic and processing.

In Dgraph, you do that with code (in any language you like) that implements custom resolvers.

One way to do this is by creating custom DQL resolvers that run efficiently directly in the Dgraph process.

Alternatively, external processes can be called during the query or mutation process. Dgraph doesn’t execute that custom logic itself - it makes external HTTP requests. That means you can deploy your custom logic into the same Kubernetes cluster as your Dgraph instance, deploy and call, for example, AWS Lambda functions, or even make calls to existing HTTP and GraphQL endpoints."_

damonfeldman avatar Oct 07 '22 18:10 damonfeldman

Sorry, which DQL extensions?

The custom directive is HTTP request https://dgraph.io/docs/graphql/custom/directive/

input CustomHTTP {
	url: String!
	method: HTTPMethod!
	body: String
	graphql: String
	mode: Mode
	forwardHeaders: [String!]
	secretHeaders: [String!]
	introspectionHeaders: [String!]
	skipIntrospection: Boolean
}

MichelDiz avatar Oct 07 '22 21:10 MichelDiz

This issue has been stale for 60 days and will be closed automatically in 7 days. Comment to keep it open.

github-actions[bot] avatar Jul 20 '24 01:07 github-actions[bot]