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

Parameters not defined in lambda examples #480

Open
damonfeldman opened this issue Feb 22, 2023 · 0 comments
Open

Parameters not defined in lambda examples #480

damonfeldman opened this issue Feb 22, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@damonfeldman
Copy link
Contributor

damonfeldman commented Feb 22, 2023

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/

@damonfeldman damonfeldman added the bug Something isn't working label Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant