INNER CODE UNIT · TypeScript

ErrorInterface

graphql-compose/graphql-compose-mongoose · src/errors/index.ts:9

  const ErrorInterface = schemaComposer.getOrCreateIFTC('ErrorInterface', (iftc) => {
    iftc.addFields({
      message: {
        description: 'Generic error message',
        type: 'String',
      },
    });

    const ValidationErrorOTC = getValidationErrorOTC(schemaComposer);
    const MongoErrorOTC = getMongoErrorOTC(schemaComposer);
    const RuntimeErrorOTC = getRuntimeErrorOTC(schemaComposer);

    ValidationErrorOTC.addInterface(iftc);
    MongoErrorOTC.addInterface(iftc);
    RuntimeErrorOTC.addInterface(iftc);

    schemaComposer.addSchemaMustHaveType(ValidationErrorOTC);
    schemaComposer.addSchemaMustHaveType(MongoErrorOTC);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…