-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add json schemas for supergraph.yaml (#216)
- Loading branch information
Showing
4 changed files
with
129 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"vscode-apollo": patch | ||
--- | ||
|
||
Add JSON schema for `supergraph.yaml`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "SupergraphConfig", | ||
"description": "The configuration for a single supergraph composed of multiple subgraphs.", | ||
"type": "object", | ||
"required": [ | ||
"subgraphs" | ||
], | ||
"properties": { | ||
"federation_version": { | ||
"anyOf": [ | ||
{ | ||
"$ref": "#/definitions/FederationVersion" | ||
}, | ||
{ | ||
"type": "null" | ||
} | ||
] | ||
}, | ||
"subgraphs": { | ||
"type": "object", | ||
"additionalProperties": { | ||
"$ref": "#/definitions/SubgraphConfig" | ||
} | ||
} | ||
}, | ||
"definitions": { | ||
"FederationVersion": { | ||
"pattern": "^(1|2|=2\\.\\d+\\.\\d+.*)$" | ||
}, | ||
"SchemaSource": { | ||
"description": "Options for getting SDL: the graph registry, a file, or an introspection URL.\n\nNOTE: Introspection strips all comments and directives from the SDL.", | ||
"anyOf": [ | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"file" | ||
], | ||
"properties": { | ||
"file": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"subgraph_url" | ||
], | ||
"properties": { | ||
"introspection_headers": { | ||
"type": [ | ||
"object", | ||
"null" | ||
], | ||
"additionalProperties": { | ||
"type": "string" | ||
} | ||
}, | ||
"subgraph_url": { | ||
"type": "string", | ||
"format": "uri" | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"graphref", | ||
"subgraph" | ||
], | ||
"properties": { | ||
"graphref": { | ||
"type": "string" | ||
}, | ||
"subgraph": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"sdl" | ||
], | ||
"properties": { | ||
"sdl": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"SubgraphConfig": { | ||
"description": "Config for a single [subgraph](https://www.apollographql.com/docs/federation/subgraphs/)", | ||
"type": "object", | ||
"required": [ | ||
"schema" | ||
], | ||
"properties": { | ||
"routing_url": { | ||
"description": "The routing URL for the subgraph. This will appear in supergraph SDL and instructs the graph router to send all requests for this subgraph to this URL.", | ||
"type": [ | ||
"string", | ||
"null" | ||
] | ||
}, | ||
"schema": { | ||
"description": "The location of the subgraph's SDL", | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/SchemaSource" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |