cjoudrey/graphql-schema-linter

Possible to ignore one or more field names from being affected by a rule?

Opened this issue · 0 comments

I wanted to try this tool with a file asking:

# Things are in alphabetical order, please keep it this way.  Exceptions being:
#   a. the id field is always the first

type Response  {
    id: Int!
    createdAt: LocalDateTime
    updatedAt: LocalDateTime
}

I noticed the --ignore PR was merged. I tried the arguments:

--rules input-object-fields-sorted-alphabetically --ignore '{"input-object-fields-sorted-alphabetically":["id"]}'
--rules input-object-fields-sorted-alphabetically --ignore '{"input-object-fields-sorted-alphabetically":[".id"]}'
--rules input-object-fields-sorted-alphabetically --ignore '{"input-object-fields-sorted-alphabetically":["Response.id"]}'

but they all resulted in same: The fields of input type Response should be sorted in alphabetical order..

The only thing that works is: --ignore '{"input-object-fields-sorted-alphabetically":["Response"]}' but that would disable it for the whole type.

Wondering if it's possible to always ignore say, just an "id" field?