|
|
@@ -15,6 +15,7 @@ class GenerateJs extends Component {
|
|
|
this.state = {
|
|
|
schemaID:props.schemaID,
|
|
|
schemaName:props.schemaName,
|
|
|
+ graphqlJs:'',
|
|
|
queryList:[],
|
|
|
mutationList:[],
|
|
|
show: false
|
|
|
@@ -33,7 +34,6 @@ class GenerateJs extends Component {
|
|
|
let mutationList = [];
|
|
|
let graphqlJs = beautify(res.data, { indent_size: 2, space_in_empty_paren: true });
|
|
|
// console.log('beautify graphqlJs',graphqlJs);
|
|
|
- // console.log('graphqlJs', graphqlJs);
|
|
|
graphqlJs.split("}\n}\n").map((item) => {
|
|
|
if (item.indexOf('query')>-1) queryList.push(item+"}\n}\n");
|
|
|
else mutationList.push(item+"}\n}\n");
|
|
|
@@ -45,6 +45,7 @@ class GenerateJs extends Component {
|
|
|
// console.log('mutationList',mutationList);
|
|
|
if (res.data !== '') {
|
|
|
_this.setState({
|
|
|
+ graphqlJs,
|
|
|
queryList,
|
|
|
mutationList,
|
|
|
show: true
|