Using the GraphQL Server
Use the GraphQL server with your Elastic Path Commerce Cloud store to access Commerce Cloud APIs using GraphQL instead of REST for shopping experiences.
Getting started with the GraphQL server
To create a
.env
file, follow the instructions in the Get Started section.Get the following variables and add to the
.env
file:In Commerce Manager home page for your store, go to the Your API keys section.
To get the value for the
ELASTICPATH_API_HOST
variable, copy the API base URL and remove thehttps://
.For example, if the API base URL is
https://api.moltin.com
, useapi.moltin.com
for theELASTICPATH_API_HOST
variable.To get the value for the
ELASTICPATH_CLIENT_ID
variable, copy the client ID.
Start the server.
note
You can use the local host URL to perform queries using GraphQL Playground.
To start using GraphQL, follow the instructions in the Your First GraphQL Queries section.