This project demonstrates how to publish a simple GraphQL to Exchange using Exchange API v2 API.
-
Get an
ANYPOINT_TOKEN
from Anypoint Platform User explained in the root README.md file of this repository -
Execute the following command in your console
Replace the fields:
-
organizationId
: organization ID of the organization where the asset will be published. -
groupId
: group ID of the asset to publish -
assetId
: asset ID of the asset to publish -
version
: version of the asset to publish -
file-path
: local path where is the fileexample.graphql
-
mainFile
: when the asset file is packaged as a zip file, the mainfile property it's used to identify the principal file -
classifier
: should begraph
orgraph-apollo
curl -v \
-H 'Authorization: bearer ANYPOINT_TOKEN' \
-F 'name=Graphql example' \
-F 'description=Description of the asset' \
-F 'properties.mainFile=example.graphql' \
-F 'files.graphql.graphql=@/:file-path/example.graph' \
https://anypoint.mulesoft.com/exchange/api/v2/organizations/:organizationId/assets/:groupId/:assetId/:version
Note the field files.graphql.graphql
where the first graphql
is the asset classifier and must be graphql
to this asset type
curl -v \
-H 'Authorization: bearer ANYPOINT_TOKEN' \
-F 'name=Graphql example' \
-F 'description=Description of the asset' \
-F 'properties.mainFile=example.graphql' \
-F 'files.graphql-apollo.graphql=@/:file-path/example-apollo.graph' \
https://anypoint.mulesoft.com/exchange/api/v2/organizations/:organizationId/assets/:groupId/:assetId/:version
Note the field files.graphql-apollo.graph
where graphql-apollo
is the asset classifier and must be graphql-apollo
to this asset type