ecoportal-api-graphql

A Ruby client for the ecoPortal GraphQL API: typed models for pages, templates, data fields and registers, query and mutation helpers, and the workflow command bus for granular template edits.

This is the README shipped inside the published gem. The source repository keeps its own developer README.

Install

gem 'ecoportal-api-graphql', require: %w[ecoportal/api-graphql]
$ bundle
# or: $ gem install ecoportal-api-graphql

Requirements

version
Ruby >= 3.2.2
ecoportal-api ~> 0.10, >= 0.10.17
ecoportal-api-v2 ~> 3.3, >= 3.3.5
graphlient >= 0.9.0, < 0.10

Example: load and edit a template

api      = Ecoportal::API::GraphQL.new(email: ..., pass: ..., org_id: ...)
template = Ecoportal::API::GraphQL::Model::Template.load(api, id: template_page_id)
template.fields.each { |f| f.label = "#{f.label} (reviewed)" }
template.save!(api, simulate: false)   # simulate: true is the default -- inspect first

save! simulates by default: it reports the commands it would send without writing anything. Pass simulate: false to apply them.

Optional extensions

Some capabilities are distributed separately as optional extensions and are not part of this gem. The gem works fully without them; when an extension is installed, it is picked up automatically.

Changes

See CHANGELOG.md, shipped alongside this file.

Licence

MIT -- see LICENSE.