api-client/components/graphql/type.vue

45 lines
803 B
Vue
Raw Normal View History

2019-11-18 20:17:07 +00:00
<template>
<div class="type-box">
<div class="type-title">{{ gqlType.name }}</div>
2019-11-18 20:17:07 +00:00
<div class="type-desc" v-if="gqlType.description">
{{ gqlType.description }}
2019-11-18 20:17:07 +00:00
</div>
<div v-if="gqlType.getFields">
<h5>{{ $t("fields") }}</h5>
2019-11-18 20:17:07 +00:00
<div v-for="field in gqlType.getFields()" :key="field.name">
<gql-field :gqlField="field" :jumpTypeCallback="jumpTypeCallback" />
2019-11-18 20:17:07 +00:00
</div>
</div>
</div>
</template>
<style scoped lang="scss">
2019-11-18 20:17:07 +00:00
.type-box {
2019-11-20 00:46:02 +00:00
padding: 16px;
margin: 4px 0;
2019-11-18 20:17:07 +00:00
}
.type-desc {
2019-11-20 00:46:02 +00:00
color: var(--fg-light-color);
margin-top: 4px;
2019-11-18 20:17:07 +00:00
}
.type-title {
2019-11-20 00:46:02 +00:00
font-weight: 700;
2019-11-18 20:17:07 +00:00
}
</style>
<script>
export default {
components: {
"gql-field": () => import("./field"),
2019-11-18 20:17:07 +00:00
},
2020-01-10 00:00:38 +00:00
2019-11-18 20:17:07 +00:00
props: {
gqlType: {},
2020-02-24 18:44:50 +00:00
jumpTypeCallback: Function,
},
}
2019-11-18 20:17:07 +00:00
</script>