feat: vars and asserts in gql request UI

This commit is contained in:
Anoop M D 2023-02-23 11:42:25 +05:30
parent b38c25ca70
commit 9e30c7b440
2 changed files with 16 additions and 2 deletions

View File

@ -8,6 +8,8 @@ import { updateRequestPaneTab } from 'providers/ReduxStore/slices/tabs';
import QueryEditor from 'components/RequestPane/QueryEditor'; import QueryEditor from 'components/RequestPane/QueryEditor';
import GraphQLVariables from 'components/RequestPane/GraphQLVariables'; import GraphQLVariables from 'components/RequestPane/GraphQLVariables';
import RequestHeaders from 'components/RequestPane/RequestHeaders'; import RequestHeaders from 'components/RequestPane/RequestHeaders';
import Vars from 'components/RequestPane/Vars';
import Assertions from 'components/RequestPane/Assertions';
import Script from 'components/RequestPane/Script'; import Script from 'components/RequestPane/Script';
import Tests from 'components/RequestPane/Tests'; import Tests from 'components/RequestPane/Tests';
import { useTheme } from 'providers/Theme'; import { useTheme } from 'providers/Theme';
@ -91,6 +93,12 @@ const GraphQLRequestPane = ({ item, collection, leftPaneWidth, onSchemaLoad, tog
case 'headers': { case 'headers': {
return <RequestHeaders item={item} collection={collection} />; return <RequestHeaders item={item} collection={collection} />;
} }
case 'vars': {
return <Vars item={item} collection={collection} />;
}
case 'assert': {
return <Assertions item={item} collection={collection} />;
}
case 'script': { case 'script': {
return <Script item={item} collection={collection} />; return <Script item={item} collection={collection} />;
} }
@ -130,9 +138,15 @@ const GraphQLRequestPane = ({ item, collection, leftPaneWidth, onSchemaLoad, tog
<div className={getTabClassname('headers')} role="tab" onClick={() => selectTab('headers')}> <div className={getTabClassname('headers')} role="tab" onClick={() => selectTab('headers')}>
Headers Headers
</div> </div>
<div className={getTabClassname('vars')} role="tab" onClick={() => selectTab('vars')}>
Vars
</div>
<div className={getTabClassname('script')} role="tab" onClick={() => selectTab('script')}> <div className={getTabClassname('script')} role="tab" onClick={() => selectTab('script')}>
Script Script
</div> </div>
<div className={getTabClassname('assert')} role="tab" onClick={() => selectTab('assert')}>
Assert
</div>
<div className={getTabClassname('tests')} role="tab" onClick={() => selectTab('tests')}> <div className={getTabClassname('tests')} role="tab" onClick={() => selectTab('tests')}>
Tests Tests
</div> </div>
@ -143,7 +157,7 @@ const GraphQLRequestPane = ({ item, collection, leftPaneWidth, onSchemaLoad, tog
) : null} ) : null}
{!isSchemaLoading && !schema ? <IconDownload size={18} strokeWidth={1.5}/> : null } {!isSchemaLoading && !schema ? <IconDownload size={18} strokeWidth={1.5}/> : null }
{!isSchemaLoading && schema ? <IconRefresh size={18} strokeWidth={1.5}/> : null } {!isSchemaLoading && schema ? <IconRefresh size={18} strokeWidth={1.5}/> : null }
<span className='ml-1'>{schema ? 'Schema' : 'Load Schema'}</span> <span className='ml-1'>Schema</span>
</div> </div>
<div <div
className='flex items-center cursor-pointer hover:underline ml-2' className='flex items-center cursor-pointer hover:underline ml-2'

View File

@ -9,7 +9,7 @@
"scripts": { "scripts": {
"clean": "rimraf dist", "clean": "rimraf dist",
"dev": "electron .", "dev": "electron .",
"dist": "electron-builder --mac", "dist": "electron-builder --win --linux --mac",
"pack": "electron-builder --dir" "pack": "electron-builder --dir"
}, },
"dependencies": { "dependencies": {