code: function allowedVariableUsage(
    schema: GraphQLSchema,
    varType: GraphQLType,
    varDefaultValue: ?ValueNode,
    locationType: GraphQLType,
    locationDefaultValue: ?mixed,
  ): boolean {
    if (isNonNullType(locationType) && !isNonNullType(varType)) {
      const hasNonNullVariableDefaultValue =
        varDefaultValue && varDefaultValue.kind !== Kind.NULL;
      const hasLocationDefaultValue = locationDefaultValue !== undefined;
      if (!hasNonNullVariableDefaultValue && !hasLocationDefaultValue) {
        return false;
      }
      const nullableLocationType = locationType.ofType;
      return isTypeSubTypeOf(schema, varType, nullableLocationType);
    }
    return isTypeSubTypeOf(schema, varType, locationType);
  }
docs: Returns true if the variable is allowed in the location it was found,
  which includes considering if default values exist for either the variable
  or the location at which it is located.