Report a Dgraph Bug
What version of Dgraph are you using?
I’m trying to run dgraph along with lambda server, using the compose file suggested here
https://dgraph.io/docs/graphql/lambda/server/
with the following image ids
$ dgraph version
Dgraph version : v21.03.0
Dgraph codename : rocket
Dgraph SHA-256 : b4e4c77011e2938e9da197395dbce91d0c6ebb83d383b190f5b70201836a773f
Commit SHA-1 : a77bbe8ae
Commit timestamp : 2021-04-07 21:36:38 +0530
Branch : HEAD
Go version : go1.16.2
Have you tried reproducing the issue with the latest release?
Yes
What is the hardware spec (RAM, OS)?
Docker on MacOS
Steps to reproduce the issue (command/config used to run Dgraph).
I’m trying to run dgraph along with lambda server. When I’m trying to update the schema that contains @lambda directive, the command would return an error that --graphql “lambda-url=…;” flag wasn’t specified during alpha startup. I assume the environment variable DGRAPH_ALPHA_GRAPHQL_LAMBDA_URL
would take care of the flag
Using the following docker-compose.yml
provided here https://dgraph.io/docs/graphql/lambda/server/
docker-compose.yml
version: "3.8"
services:
dgraph:
image: dgraph/standalone:latest
environment:
DGRAPH_ALPHA_GRAPHQL_LAMBDA_URL: "http://dgraph_lambda:8686/graphql-worker"
ports:
- "8080:8080"
- "9080:9080"
- "8000:8000"
volumes:
- dgraph:/dgraph
dgraph_lambda:
image: dgraph/dgraph-lambda:latest
ports:
- "8686:8686"
environment:
DGRAPH_URL: http://dgraph:8080
volumes:
- ./gql/script.js:/app/script/script.js:ro
volumes:
dgraph: {}
gql/schema.gql
type Test {
number: Float
luckyNumber: Float @lambda
}
gql/script.js
self.addGraphQLResolvers({
"Test.luckyNumber": () => Math.random()
})
running the command
docker-compose up
then when the server is started run
curl -X POST localhost:8080/admin/schema --data-binary '@gql/schema.gql'
Expected behaviour and actual result.
Expected behaviour:
output
{"data":{"code":"Success","message":"Done"}}%
actual result
{"errors":[{"message":"resolving updateGQLSchema failed because input:3: Type Test; Field luckyNumber: has the @lambda directive, but the --graphql \"lambda-url=...;\" flag wasn't specified during alpha startup.\n (Locations: [{Line: 3, Column: 4}])","extensions":{"code":"Error"}}]}