fix: fixed bug where gql imports were not working

This commit is contained in:
Anoop M D 2023-02-09 15:11:05 +05:30
parent c55f9d42da
commit efd15838aa

View File

@ -307,7 +307,7 @@ const registerRendererEventHandlers = (mainWindow, watcher, lastOpenedCollection
// Recursive function to parse the collection items and create files/folders // Recursive function to parse the collection items and create files/folders
const parseCollectionItems = (items = [], currentPath) => { const parseCollectionItems = (items = [], currentPath) => {
items.forEach(item => { items.forEach(item => {
if (item.type === 'http-request') { if (['http-request', 'graphql-request'].includes(item.type)) {
const content = jsonToBru(item); const content = jsonToBru(item);
const filePath = path.join(currentPath, `${item.name}.bru`); const filePath = path.join(currentPath, `${item.name}.bru`);
fs.writeFileSync(filePath, content); fs.writeFileSync(filePath, content);