To delete a contract, please use federated-graph delete.
Usage
Exclude (the items that have the tag(s) specified will be removed from the federated graph)
By default, all top-level nodes will be included in the schema unless explicitly excluded.Include (the items that have the tag(s) specified will be included in the federated graph)
Child nodes inherit inclusion from their parent unless explicitly excluded.
For example, an included Object would include all its field unless explicitly excluded.
Similarly, an included field would include all its field arguments unless explicitly excluded.
Include and exclude together
Minimum Requirements
If both include and exclude tags are provided, the behaviour is thus:- The schema starts blank (no nodes)
- Top-level (parent) nodes (Enums, Inputs, Interfaces, Objects, Scalars, and Unions) are included if they define a specified tag to include.
- Child-level nodes (Enum values, Input fields, Interface fields, Object fields) are also included unless the child defines a specified tag to exclude.
- Argument nodes (Object field arguments and Interface field arguments) are included if the corresponding field is included unless the field argument defines a specified tag to exclude.
Description
Thenpx wgc contract create command allows you to create a contract from a federated graph or monograph by providing
tags to exclude from the schema.
This will create a new contract graph linked to the source graph.
Parameters
<name>: The name of the contract graph you want to create.
Required Options
-r , --routing-url: The routing URL of your router. This URL defines the endpoint where the router will be accessible.
The contract graph will be accessible through this router.
--source: The name of the source graph from which contract is created.
Options
-n, --namespace: The namespace of the contract graph and source graph (Default: “default”).--exclude: The list of tags that need to be excluded from the source graph schema.--include: The list of tags that need to be included from the source graph schema.--admission-webhook-url <url>the base url of the admission webhook. This is the url that the controlplane will use to implement admission control for the contract graph. Example:https://admission.example.com(without the/validate-configpath name)--admission-webhook-secret: Allows you to sign requests (HMAC) made to your admission webhook url. The header containing this signature isX-Cosmo-Signature-256--readme: The markdown file which describes the contract graph.--suppress-warnings: This flag suppresses any warnings produced by composition.
Examples
Create a contract graph namedproduction-external from the source graph schema of production that excludes all
schema elements tagged with internal or experimental:
production-external from the source graph schema of production that includes all
schema elements tagged with public or api:
public-api from the source graph schema of supergraph that includes all
schema elements tagged with core or api and excludes all schema elements tagged with classified or internal: