How to use the assertInputObjectType function from graphql

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

495
496
497
498
499
500
501
502
503
504
  }
  if (typeof filters === 'boolean') return filters;
  if (!filters) return false; // shouldn't happen, but, Typescript

  const schema = context.sudo().graphql.schema;
  const whereInput = graphql.assertInputObjectType(schema.getType(core.getGqlNames(list).whereInputName));
  const result = coerceAndValidateForGraphQLInput(schema, whereInput, filters);
  if (result.kind === 'valid') return result.value;
  throw result.error;
} catch (error) {
fork icon0
star icon0
watch icon1

+ 8 other calls in file

643
644
645
646
647
648
649
650
651
652
  passwordResetLink,
  magicAuthLink,
  sessionData
} = _ref;
return core.graphql.extend(base => {
  const uniqueWhereInputType = graphql.assertInputObjectType(base.schema.getType(`${listKey}WhereUniqueInput`));
  const identityFieldOnUniqueWhere = uniqueWhereInputType.getFields()[identityField];
  if ((identityFieldOnUniqueWhere === null || identityFieldOnUniqueWhere === void 0 ? void 0 : identityFieldOnUniqueWhere.type) !== graphql.GraphQLString && (identityFieldOnUniqueWhere === null || identityFieldOnUniqueWhere === void 0 ? void 0 : identityFieldOnUniqueWhere.type) !== graphql.GraphQLID) {
    throw new Error(`createAuth was called with an identityField of ${identityField} on the list ${listKey} ` + `but that field doesn't allow being searched uniquely with a String or ID. ` + `You should likely add \`isIndexed: 'unique'\` ` + `to the field at ${listKey}.${identityField}`);
  }
fork icon0
star icon0
watch icon0

+ 9 other calls in file