Skip to content

Commit

Permalink
Allow to change schema
Browse files Browse the repository at this point in the history
  • Loading branch information
spawnia committed Apr 27, 2023
1 parent d8e0434 commit ec4c455
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## v2.2.0

### Added

- Allow to change schema https://github.com/IvanGoncharov/graphql-voyager/issues/184

## v2.1.1

### Fixed
Expand Down
22 changes: 7 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,13 @@ You can use that for all kinds of customization.

### Change settings of the GraphQL Voyager instance

Check https://github.com/APIs-guru/graphql-voyager#properties for the allowed config options, for example:

```html
<div id="voyager">Loading...</div>
<script>
function introspectionProvider(introspectionQuery) {
// ... do a call to server using introspectionQuery provided
// or just return pre-fetched introspection
}
// Render <Voyager />
GraphQLVoyager.init(document.getElementById("voyager"), {
introspection: introspectionProvider,
});
</script>
Check https://github.com/APIs-guru/graphql-voyager#properties for the allowed config options.
You may change them in the published view where `GraphQLVoyager.init()` is called, for example:

```diff
GraphQLVoyager.init(document.getElementById('voyager'), {
+ someOption: 'some-value',
});
```

## Local assets
Expand Down
1 change: 1 addition & 0 deletions views/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
credentials: 'include',
}).then((response) => response.json())
: undefined,
allowToChangeSchema: true,
});
</script>

Expand Down

0 comments on commit ec4c455

Please sign in to comment.