title: in a graphql schema directive, is there any way to check if the expected return field is non-nullable
body: <p>I have a schema directive that does a db query and returns the expected result. Some fields where I use this directive are non-nullable. Which means in the case where there's bad user input like the client asking for some data that doesn't exist, the client will get a "Can't return null for non nullable field" general exception. While this is ok, it would be better if I could throw a UserInputError </p>
  
  <p>When I'm doing this in resolvers, since I know what the field is, I simply check if the return value is null and throw new UserInputError. In the directive I don't know if the field is nullable though, so I don't know when to return null or throw. Is there a way to check?</p>
  
  <p>here's the code:</p>
  
  <pre><code>export class QueryDirective extends SchemaDirectiveVisitor {
    visitFieldDefinition(field) {
      const { resolve = defaultFieldResolver } = field;
      const directiveArgs = { ...this.args };
      field.resolve = async function(obj, args, context, info) {
        const session = context.driver.session();
        let queryResult = await session.run(directiveArgs.statement, args);
        session.close();
        let result = extractResult(result, "result");
        // Any way to check here if field is non-nullable and throw new UserInputError?
        if (!directiveArgs.resolve) return resolve.call(this, result, args, context, info);
        else return result;
      };
    }
  }
  </code></pre>