Moved Cocs section to right sidebar (will fix overflow issue later today) + Basic lint

This commit is contained in:
Liyas Thomas
2019-11-19 08:55:57 +05:30
parent 8e3542863a
commit eca1dc8e66
3 changed files with 128 additions and 77 deletions

View File

@@ -36,12 +36,19 @@ export default {
computed: {
fieldString() {
const args = (this.gqlField.args || []).reduce((acc, arg, index) => {
return acc + `${arg.name}: ${arg.type.toString()}${(index !== this.gqlField.args.length - 1) ? ", " : ''}`;
}, '');
const argsString = (args.length > 0) ? `(${args})` : '';
return (
acc +
`${arg.name}: ${arg.type.toString()}${
index !== this.gqlField.args.length - 1 ? ", " : ""
}`
);
}, "");
const argsString = args.length > 0 ? `(${args})` : "";
return `${this.gqlField.name}${argsString}: ${this.gqlField.type.toString()}`;
return `${
this.gqlField.name
}${argsString}: ${this.gqlField.type.toString()}`;
}
}
}
};
</script>

View File

@@ -1,8 +1,8 @@
<template>
<div class="type-box">
<div class="type-title">{{gqlType.name}}</div>
<div class="type-title">{{ gqlType.name }}</div>
<div class="type-desc" v-if="gqlType.description">
{{gqlType.description}}
{{ gqlType.description }}
</div>
<div v-if="gqlType.getFields">
@@ -43,5 +43,5 @@ export default {
props: {
gqlType: Object
}
}
};
</script>