File tree Expand file tree Collapse file tree 9 files changed +33
-15
lines changed Expand file tree Collapse file tree 9 files changed +33
-15
lines changed Original file line number Diff line number Diff line change 11
11
runs-on : ubuntu-latest
12
12
strategy :
13
13
matrix :
14
- node-version : [16 .x]
14
+ node-version : [20 .x]
15
15
steps :
16
16
- name : Checkout
17
17
uses : actions/checkout@v3
53
53
env :
54
54
DOCKER_USER : ${{ secrets.DOCKER_USER }}
55
55
DOCKER_AUTH : ${{ secrets.DOCKER_AUTH }}
56
+ REACT_APP_API_SUBSCRIPTION_KEY : ${{ secrets.REACT_APP_API_SUBSCRIPTION_KEY }}
57
+ REACT_APP_DEV_API_SUBSCRIPTION_KEY : ${{ secrets.REACT_APP_DEV_API_SUBSCRIPTION_KEY }}
Original file line number Diff line number Diff line change 23
23
env :
24
24
DOCKER_USER : ${{ secrets.DOCKER_USER }}
25
25
DOCKER_AUTH : ${{ secrets.DOCKER_AUTH }}
26
+ REACT_APP_API_SUBSCRIPTION_KEY : ${{ secrets.REACT_APP_API_SUBSCRIPTION_KEY }}
27
+ REACT_APP_DEV_API_SUBSCRIPTION_KEY : ${{ secrets.REACT_APP_DEV_API_SUBSCRIPTION_KEY }}
Original file line number Diff line number Diff line change 2
2
< html lang ="en ">
3
3
< head >
4
4
< meta charset ="utf-8 " />
5
- < link rel ="icon " href ="%PUBLIC_URL%/favicon.ico " />
5
+ < link rel ="icon " href ="%PUBLIC_URL%/favicon.png " />
6
6
< meta name ="viewport " content ="width=device-width, initial-scale=1 " />
7
7
<!--
8
8
manifest.json provides metadata used when your web app is installed on a
14
14
It will be replaced with the URL of the `public` folder during the build.
15
15
Only files inside the `public` folder can be referenced from the HTML.
16
16
17
- Unlike "/favicon.ico " or "favicon.ico ", "%PUBLIC_URL%/favicon.ico " will
17
+ Unlike "/favicon.png " or "favicon.png ", "%PUBLIC_URL%/favicon.png " will
18
18
work correctly both with client-side routing and a non-root public URL.
19
19
Learn how to configure a non-root public URL by running `npm run build`.
20
20
-->
Original file line number Diff line number Diff line change 3
3
"name" : " GraphiQL deployment" ,
4
4
"icons" : [
5
5
{
6
- "src" : " favicon.ico " ,
7
- "sizes" : " 64x64 32x32 24x24 16x16" ,
8
- "type" : " image/x-icon "
6
+ "src" : " favicon.png " ,
7
+ "sizes" : " 96x96 64x64 32x32 24x24 16x16" ,
8
+ "type" : " image/png "
9
9
}
10
10
],
11
11
"start_url" : " ." ,
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
- import { useParams } from 'react-router-dom' ;
3
- import { API_VERSION_2 , DIALECT_VERSION_1 , CONFIG_LIST } from '../config' ;
2
+ import { useParams , Navigate } from 'react-router-dom' ;
3
+ import {
4
+ API_VERSION_2 ,
5
+ DIALECT_VERSION_1 ,
6
+ CONFIG_LIST ,
7
+ DEFAULT_PATH ,
8
+ } from '../config' ;
4
9
import { getApiConfig } from './utils' ;
5
10
import CustomGraphiQL from './CustomGraphiQL' ;
6
11
@@ -13,5 +18,8 @@ export default () => {
13
18
'gtfs' ,
14
19
DIALECT_VERSION_1 ,
15
20
) ;
21
+ if ( ! config ) {
22
+ return < Navigate to = { DEFAULT_PATH } /> ;
23
+ }
16
24
return < CustomGraphiQL config = { config } configList = { CONFIG_LIST } /> ;
17
25
} ;
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
- import { useParams } from 'react-router-dom' ;
3
- import { API_VERSION_1 , CONFIG_LIST } from '../config' ;
2
+ import { useParams , Navigate } from 'react-router-dom' ;
3
+ import { API_VERSION_1 , CONFIG_LIST , DEFAULT_PATH } from '../config' ;
4
4
import { getApiConfig } from './utils' ;
5
5
import CustomGraphiQL from './CustomGraphiQL' ;
6
6
7
7
export default ( ) => {
8
8
const { router } = useParams ( ) ;
9
9
const config = getApiConfig ( CONFIG_LIST , router , API_VERSION_1 ) ;
10
+ if ( ! config ) {
11
+ return < Navigate to = { DEFAULT_PATH } /> ;
12
+ }
10
13
return < CustomGraphiQL config = { config } configList = { CONFIG_LIST } /> ;
11
14
} ;
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
- import { useParams } from 'react-router-dom' ;
3
- import { API_VERSION_2 , CONFIG_LIST } from '../config' ;
2
+ import { useParams , Navigate } from 'react-router-dom' ;
3
+ import { API_VERSION_2 , CONFIG_LIST , DEFAULT_PATH } from '../config' ;
4
4
import { getApiConfig } from './utils' ;
5
5
import CustomGraphiQL from './CustomGraphiQL' ;
6
6
@@ -13,5 +13,8 @@ export default () => {
13
13
dialect ,
14
14
dialectVersion ,
15
15
) ;
16
+ if ( ! config ) {
17
+ return < Navigate to = { DEFAULT_PATH } /> ;
18
+ }
16
19
return < CustomGraphiQL config = { config } configList = { CONFIG_LIST } /> ;
17
20
} ;
Original file line number Diff line number Diff line change @@ -56,12 +56,12 @@ export function getPath(
56
56
dialectVersion ,
57
57
) {
58
58
if ( isDefault ) {
59
- return `/${ router } ` ;
59
+ return `/graphiql/ ${ router } ` ;
60
60
}
61
61
62
62
return apiVersion === API_VERSION_2
63
- ? `/${ router } /${ apiVersion } /${ dialect } /${ dialectVersion } `
64
- : `/${ router } /${ apiVersion } ` ;
63
+ ? `/graphiql/ ${ router } /${ apiVersion } /${ dialect } /${ dialectVersion } `
64
+ : `/graphiql/ ${ router } /${ apiVersion } ` ;
65
65
}
66
66
67
67
export function getQueryString ( query , variables , operationName ) {
You can’t perform that action at this time.
0 commit comments