mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-23 04:35:40 +00:00
fix: crash when saving empty GraphQL query in YAML collections (#6453)
* fix: ensure GraphQL variables are handled correctly in multiple components * fix: reverted some changes * chore: temp fix for tests --------- Co-authored-by: Bijin A B <bijin@usebruno.com>
This commit is contained in:
@@ -46,8 +46,8 @@ const GraphQLRequestPane = ({ item, collection, onSchemaLoad, toggleDocs, handle
|
||||
? get(item, 'draft.request.body.graphql.query', '')
|
||||
: get(item, 'request.body.graphql.query', '');
|
||||
const variables = item.draft
|
||||
? get(item, 'draft.request.body.graphql.variables')
|
||||
: get(item, 'request.body.graphql.variables');
|
||||
? get(item, 'draft.request.body.graphql.variables', '')
|
||||
: get(item, 'request.body.graphql.variables', '');
|
||||
|
||||
const { displayedTheme } = useTheme();
|
||||
const [schema, setSchema] = useState(null);
|
||||
|
||||
@@ -29,8 +29,8 @@ const parseGraphQLRequest = (ocRequest: GraphQLRequest): BrunoItem => {
|
||||
formUrlEncoded: [],
|
||||
multipartForm: [],
|
||||
graphql: {
|
||||
query: (graphql?.body as GraphQLBody)?.query || null,
|
||||
variables: (graphql?.body as GraphQLBody)?.variables || null
|
||||
query: (graphql?.body as GraphQLBody)?.query || '',
|
||||
variables: (graphql?.body as GraphQLBody)?.variables || ''
|
||||
},
|
||||
file: []
|
||||
},
|
||||
|
||||
@@ -382,6 +382,7 @@ const createEnvironment = async (
|
||||
await expect(page.locator('.request-tab').filter({ hasText: tabLabel })).toBeVisible();
|
||||
|
||||
const locators = buildCommonLocators(page);
|
||||
await page.waitForTimeout(200); // @TODO replace with dynamic waiting logic
|
||||
await locators.environment.selector().click();
|
||||
if (type === 'global') {
|
||||
await locators.environment.globalTab().click();
|
||||
|
||||
Reference in New Issue
Block a user