/
alt3rmann
/
graphql-engine
Обзор
Документация
Войти
/
alt3rmann
/
graphql-engine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
cli-ext/src/services/actions-codegen/codegen.js
41 строка
932 B
Anuj Shah
cli-ext: setup linting and prettification (#4463)
19 май 2020, 14:01
Не верифицирован
19 май 2020, 14:01
3f631ca
Код
Авторство
О чём код?
const fetch = require('node-fetch'); const { parse: sdlParse } = require('graphql/language/parser'); const { getTemplatePath } = require('../../utils/utils'); const { parseCustomTypes, getActionTypes, } = require('../../shared/utils/hasuraCustomTypeUtils'); const { getFrameworkCodegen } = require('./template'); const { getActionDefinitionSdl, getTypesSdl, } = require('../../shared/utils/sdlUtils'); const getActionsCodegen = async (payload) => { const { action_name: actionName, sdl: { complete: sdlComplete }, derive, codegen_config: codegenConfig, } = payload; try { const codegenResp = await getFrameworkCodegen( actionName, sdlComplete, derive, codegenConfig, ); if (codegenResp.error) { throw Error(codegenResp.error); } else { return codegenResp.files; } } catch (e) { throw e; } }; module.exports = { getActionsCodegen, };