dgraph-io / dgraph-docs

A native GraphQL Database with a graph backend
https://dgraph.io/docs
Other
35 stars 66 forks source link

Parameters not defined in lambda examples #480

Closed damonfeldman closed 4 months ago

damonfeldman commented 1 year ago

Generally, all functions in all docs should be documented with their input paramters, parameter types, and return type to be complete, but lambda functions do not include types. Also it appears the functions vary based on how they are added (via addGraphQLResolvers() or dql version, etc.).

This is in v22.0 docs.

https://dgraph.io/docs/graphql/lambda/mutation docs describe javascript functions with signature:

async function authorsByName({args, dql})

with a note that " Note A Lambda Query resolver can use a combination of parents, args, dql, or graphql inside the function. "

but the type, structure and use of parents, args, dql, and graphql are not defined. From the code, it seems dql is a thing that has a query function (dql.query(...)) but it's unclear what it is, and if the key to using them is to use these particular variable names in the functions.

Similarly https://dgraph.io/docs/graphql/lambda/query/ uses graphql, which appears to be a simple function. const results = await graphql('mutation ($name: String!)

Similar for use of parents in https://dgraph.io/docs/graphql/lambda/field/

github-actions[bot] commented 4 months ago

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