- name: ignores valid fields including __typename rule: NoSchemaIntrospectionCustom schema: 9 query: |2- { someQuery { __typename someField } } errors: [] - name: ignores fields not in the schema rule: NoSchemaIntrospectionCustom schema: 9 query: |2- { __introspect } errors: [] - name: reports error when a field with an introspection type is requested rule: NoSchemaIntrospectionCustom schema: 9 query: |2- { __schema { queryType { name } } } errors: - message: GraphQL introspection has been disabled, but the requested query contained the field "__schema". locations: - {line: 3, column: 9} - message: GraphQL introspection has been disabled, but the requested query contained the field "queryType". locations: - {line: 4, column: 11} - name: reports error when a field with an introspection type is requested and aliased rule: NoSchemaIntrospectionCustom schema: 9 query: |2- { s: __schema { queryType { name } } } errors: - message: GraphQL introspection has been disabled, but the requested query contained the field "__schema". locations: - {line: 3, column: 9} - message: GraphQL introspection has been disabled, but the requested query contained the field "queryType". locations: - {line: 4, column: 11} - name: reports error when using a fragment with a field with an introspection type rule: NoSchemaIntrospectionCustom schema: 9 query: |2- { ...QueryFragment } fragment QueryFragment on Query { __schema { queryType { name } } } errors: - message: GraphQL introspection has been disabled, but the requested query contained the field "__schema". locations: - {line: 7, column: 9} - message: GraphQL introspection has been disabled, but the requested query contained the field "queryType". locations: - {line: 8, column: 11} - name: reports error for non-standard introspection fields rule: NoSchemaIntrospectionCustom schema: 9 query: |2- { someQuery { introspectionField } } errors: - message: GraphQL introspection has been disabled, but the requested query contained the field "introspectionField". locations: - {line: 4, column: 11}