-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* (feat) add graphql tab * (feat) add gql to axios req
- Loading branch information
1 parent
5b42c29
commit 3be4d95
Showing
6 changed files
with
91 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
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,41 @@ | ||
import * as React from "react"; | ||
import { Editor } from "../../../shared/Editor"; | ||
import "./styles.css"; | ||
import { useAppDispatch, useAppSelector } from "../../../redux/hooks"; | ||
import { | ||
requestBodyGraphqlQueryUpdated, | ||
requestBodyGraphqlVariablesUpdated, | ||
selectRequestBodyGraphqlQuery, | ||
selectRequestBodyGraphqlVariables, | ||
} from "../requestBodySlice"; | ||
|
||
export const GraphQL = () => { | ||
const query = useAppSelector(selectRequestBodyGraphqlQuery); | ||
const variables = useAppSelector(selectRequestBodyGraphqlVariables); | ||
const dispatch = useAppDispatch(); | ||
|
||
return ( | ||
<div className="gql-wrapper"> | ||
<div className="gql-section"> | ||
<div className="gql-section-heading">QUERY</div> | ||
<Editor | ||
className="gql-editor" | ||
value={query} | ||
language="graphql" | ||
onChange={(data) => dispatch(requestBodyGraphqlQueryUpdated(data))} | ||
/> | ||
</div> | ||
<div className="gql-section"> | ||
<div className="gql-section-heading">VARIABLES</div> | ||
<Editor | ||
className="gql-editor" | ||
value={variables} | ||
language="json" | ||
onChange={(data) => | ||
dispatch(requestBodyGraphqlVariablesUpdated(data)) | ||
} | ||
/> | ||
</div> | ||
</div> | ||
); | ||
}; |
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,23 @@ | ||
.gql-wrapper { | ||
display: flex; | ||
height: 100%; | ||
margin-top: 10px; | ||
} | ||
|
||
.gql-section { | ||
height: 95%; | ||
padding: 0 10px 0 10px; | ||
display: flex; | ||
flex-direction: column; | ||
flex: 1; | ||
} | ||
|
||
.gql-section-heading { | ||
font-size: var(--default-font-size); | ||
padding-bottom: 10px; | ||
font-weight: 700; | ||
} | ||
|
||
.gql-editor { | ||
height: 90%; | ||
} |
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