Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

670 B
Raw Blame
<template>
  <GqlExplorerSection v-if="interfaces.length > 0" title="Implements">
    <div
      v-for="implementedInterface in interfaces"
      :key="implementedInterface.name"
      class="px-4 py-2 transition hover:bg-primaryLight"
    >
      <GqlTypeLink :type="implementedInterface" :clickable="true" />
    </div>
  </GqlExplorerSection>
</template>

<script setup lang="ts">
import { computed } from "vue"
import { isObjectType, GraphQLNamedType } from "graphql"

const props = defineProps<{
  type: GraphQLNamedType
}>()

const interfaces = computed(() => {
  if (!isObjectType(props.type)) {
    return []
  }
  return props.type.getInterfaces()
})
</script>