Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compose from running services, registered graphs or subgraphs #519

Merged
merged 22 commits into from
May 11, 2021
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,31 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
[EverlastingBugstopper]: https://github.com/EverlastingBugstopper
[pull/492]: https://github.com/apollographql/rover/pull/492

- **`rover supergraph compose` allows for registry and introspection SDL sources - [lrlna], [issue/449] [pull/519]**

Pulls subgraphs from various sources specified in the YAML config file. A valid config can now specify schema using Apollo Registry refs (`subgraph`, `graphref`), introspection(`url`) and subgraph introspection (`subgraph_url`):
lrlna marked this conversation as resolved.
Show resolved Hide resolved

```yaml
subgraphs:
films:
routing_url: https://films.example.com
schema:
file: ./films.graphql
people:
schema:
subgraph_url: https://example.com/people
reviews:
schema:
url: https://reviews.example.com
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Today, we can only compose federated subgraphs into a supergraph. I can imagine that working in a future version, but today, we necessitate the presence of federated directives (e.g., @key, @requires, etc.) to dictate/inform the composition.

actors:
schema:
graphref: mygraph@current
subgraph: actors
```
[lrlna]: https://github.com/lrlna
[issue/449]: https://github.com/apollographql/rover/issues/449
[pull/519]: https://github.com/apollographql/rover/pull/519

- **`--routing-url` is now an optional argument to `rover subgraph publish` - [EverlastingBusgtopper], [issue/169] [pull/484]**

When publishing a subgraph, it is important to include a routing URL for that subgraph, so your graph router
Expand Down
7 changes: 7 additions & 0 deletions docs/source/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,10 @@ This error occurs when working with a federated graph and its subgraphs. When gr
To resolve this error, inspect the printed errors and correct the subgraph schemas.


### E028

This error occurs when a connection could not be established with to an introspection endpoint.

To resolve this problem, make sure the endpoint URL is correct. You may wish to run the command again with `--log=debug`.


22 changes: 21 additions & 1 deletion docs/source/supergraphs.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,27 @@ subgraphs:
file: ./people.graphql
```

The YAML file must specify each subgraph's public-facing URL (`routing_url`), along with the path to its schema (`schema.file`).
In the above example, The YAML file specifies each subgraph's public-facing URL (`routing_url`), along with the path to its schema (`schema.file`).

It's also possible to pull subgraphs from various sources and specify them in the YAML file. For example, here is a configuration that specifies schema using Apollo Registry refs (`subgraph`, `graphref`), introspection(`url`) and subgraph introspection (`subgraph_url`):
lrlna marked this conversation as resolved.
Show resolved Hide resolved

```yaml
subgraphs:
films:
routing_url: https://films.example.com
schema:
file: ./films.graphql
people:
schema:
subgraph_url: https://example.com/people
reviews:
schema:
url: https://reviews.example.com
lrlna marked this conversation as resolved.
Show resolved Hide resolved
actors:
schema:
graphref: mygraph@current
subgraph: actors
```

### Output format

Expand Down
6 changes: 3 additions & 3 deletions installers/binstall/src/system/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ fn get_windows_path_var() -> Result<Option<String>, InstallerError> {
}
}
Err(ref e) if e.kind() == io::ErrorKind::NotFound => Ok(Some(String::new())),
Err(e) => Err(e)?,
Err(e) => Err(e.into()),
}
}

Expand Down Expand Up @@ -83,7 +83,7 @@ fn add_to_path(old_path: &str, path_str: &str) -> Option<String> {
None
} else {
let mut new_path = path_str.to_string();
new_path.push_str(";");
new_path.push(';');
new_path.push_str(&old_path);
Some(new_path)
}
Expand Down Expand Up @@ -116,7 +116,7 @@ fn apply_new_path(new_path: &str) -> Result<(), InstallerError> {
SendMessageTimeoutA(
HWND_BROADCAST,
WM_SETTINGCHANGE,
0 as WPARAM,
0_usize,
"Environment\0".as_ptr() as LPARAM,
SMTO_ABORTIFHUNG,
5000,
Expand Down
Loading