Skip to content
Workshop Code examples
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
appinclass
graphapi-examples
.gitignore
README.md
guide.txt

README.md

Creating serverless applications using graphql

Presentation Slides

Technical Requirements

Starting

az login
az account list
# az account set --subscription "Visual Studio Enterprise"

RESOURCE=graphqlsfnode
LOCATION=eastus
STORAGE_ACCOUNT=graphapi
FUNCTION_APP=graphapi-examples
ACCOUNT_NAME_WEB_SITE=graphapi
ACCOUNT_NAME=graphapi
FUNCTION_NAME=heroes

func init $FUNCTION_APP
cd $FUNCTION_APP
func new --template "Http Trigger" --name $FUNCTION_NAME
cd $FUNCTION_NAME
npm init -y
npm i apollo-server-azure-functions
npm i graphql

add $return to function.json

npm i graphql-mongodb-projection

Publishing

az group create --name $RESOURCE --location $LOCATION

az storage account create
--name $STORAGE_ACCOUNT
--location $LOCATION
--resource-group $RESOURCE
--sku Standard_LRS

az functionapp create
--resource-group $RESOURCE
--name $FUNCTION_APP
--consumption-plan-location $LOCATION
--runtime node
--storage-account $STORAGE_ACCOUNT

func azure functionapp publish $FUNCTION_APP

Cleaning up

az functionapp delete \
    --resource-group $RESOURCE \
    --name $FUNCTION_APP

az storage account delete \
    --name $STORAGE_ACCOUNT \
    --resource-group $RESOURCE \
    --yes

Keep in touch!

You can’t perform that action at this time.