How to use the isInterfaceType function from graphql

Find comprehensive JavaScript graphql.isInterfaceType code examples handpicked from public code repositorys.

28
29
30
31
32
33
34
35
36
37
// Is exposed by more than one service
return getDuplicateTypes(allTypes)
  .filter(type => {
    // Has to be object, interface or input
    const isEligibleType =
      isObjectType(type) || isInterfaceType(type) || isInputType(type)
    // Is not an entity
    const isNotEntity = !type.astNode.directives.find(
      directive => directive.name.value === 'key'
    )
fork icon4
star icon14
watch icon1

27
28
29
30
31
32
33
34
35
36

function getFields(field, schema, depth = 2, options) {
  const fieldType = getType_1.default(field.type);
  const renderS3FieldFragment = options.useExternalFragmentForS3Object && isS3Object_1.default(fieldType);
  const subFields =
    !renderS3FieldFragment && (graphql_1.isObjectType(fieldType) || graphql_1.isInterfaceType(fieldType))
      ? fieldType.getFields()
      : [];
  const subFragments =
    graphql_1.isInterfaceType(fieldType) || graphql_1.isUnionType(fieldType) ? schema.getPossibleTypes(fieldType) : {};
fork icon2
star icon14
watch icon2

+ 11 other calls in file