This section of the guide helps you get up and running with a GraphQL server in a matter of seconds (depending on your internet connection). If you have already setup your project and are looking to dive deeper into Glide, you may find the Advanced Topics section of the guide more useful.
Glide must be installed globally in order to use the bundled command-line tools.
# If you are using npm
npm install --global @postlight/glide
# If you are using yarn
yarn global add @postlight/glide
If you wish to keep your global namespace clean, you may alternatively use npx
.
npx @postlight/glide <command> [...options]
Glide uses a JSON configuration file to connect, read, and write data to and from your Salesforce instance. By default, this configuration is stored in a glide.json
file located within the directory of your project.
When starting a new project or adding glide to an existing project, you may execute the init
command with your Salesforce instance URL as the first argument. This will create a JSON configuration file in the current directory with schema definitions pre-populated from your Salesforce data models. The JSON configuration file should be checked in to version control.
glide init https://my-salesforce-instance.salesforce.com
Note:
If you have not used Glide with your Salesforce instance before, you may be prompted to login. More information about how authentication works in Glide can be found in the Advanced Topics section of the guides.
Once you have a JSON configuration file in the root directory of your project, you may spawn a GraphQL server by executing the serve
command. When executing the serve
command in a development environment, your default browser will open a GraphQL Playground playground page to start exploring your data.
You manually edit your JSON configuration file if you wish to modify the mutations, queries, and/or data types exposed by your GraphQL server. Information about how to configure the generated GraphQL schema can be found in the Advanced Topics section of the guides.