Setting up GraphQL access via IDE
If creating an integration via IDE you can set up a config file to manage access and add your User API token generated in SolarPlus under 'Integrations'.
{ "name": "SolaPlus Live", "schemaPath": "schema.graphql", "extensions": { "endpoints": { "Default GraphQL Endpoint": { "url": "https://go.solarplus.co/graphql", "headers": { "user-agent": "JS GraphQL", "authorization": "Bearer ~add-token-here~" }, "introspect": false } } } }
Query the API
Add ID variable
{
"id": 181043
}
query Inventory($id: ID!) { Inventory(id: $id) { id name created } }
Result:
{ "data": { "System": { "id": "181043", "name": "9.6 kW Primo Telsa", "created": "2021-06-25 04:34:14" } }
Creating a Mutation
Update or delete a variable