This repository was archived by the owner on Feb 14, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +29
-2
lines changed Expand file tree Collapse file tree 1 file changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -31,9 +31,36 @@ You may publish the configuration and/or the views:
31
31
## Usage
32
32
33
33
By default, the playground is reachable at ` /graphql-playground `
34
+ and assumes a running GraphQL endpoint at ` /graphql ` .
34
35
35
- It assumes a running GraphQL endpoint at ` /graphql ` . You can enter another URL in the
36
- UI or change the default setting in the configuration file.
36
+ If your endpoint is located somewhere else, you can change the setting
37
+ in the published ` config/graphql-playground.php ` :
38
+
39
+ ``` php
40
+ 'endpoint' => 'any-url.com/route',
41
+ ```
42
+
43
+ If you want to change arbitrary options of the UI, you can publish the view
44
+ and add [ possible settings to the playground instance] ( https://github.com/prisma/graphql-playground#properties ) ,
45
+ for example:
46
+
47
+ ``` php
48
+ <div id =" root" />
49
+ <script type =" text/javascript" >
50
+ window .addEventListener (' load' , function (event ) {
51
+ const loadingWrapper = document .getElementById (' loading-wrapper' );
52
+ loadingWrapper .classList .add (' fadeOut' );
53
+ const root = document .getElementById (' root' );
54
+ root .classList .add (' playgroundIn' );
55
+ GraphQLPlayground .init (root, {
56
+ endpoint: " {{url(config('graphql-playground.endpoint'))}}" ,
57
+ settings: {
58
+ ' request.credentials' : ' same-origin' ,
59
+ },
60
+ })
61
+ })
62
+ </script >
63
+ ```
37
64
38
65
### Local assets
39
66
You can’t perform that action at this time.
0 commit comments