class_docstr: Fields on correct type
  
  A GraphQL document is only valid if all fields selected are defined by the
  parent type, or are an allowed meta field such as __typenamme
class_docstr_tok: ["Fields","on","correct","type","A","GraphQL","document","is","only","valid","if","all","fields","selected","are","defined","by","the","parent","type",",","or","are","an","allowed","meta","field","such","as","__typenamme"]
code: def enter_Field(self, node, key, parent, path, ancestors):
      parent_type = self.context.get_parent_type()
      if not parent_type:
          return
  
      field_def = self.context.get_field_def()
      if not field_def:
          #  This field doesn't exist, lets look for suggestions.
          schema = self.context.get_schema()
          field_name = node.name.value
  
          # First determine if there are any suggested types to condition on.
          suggested_type_names = get_suggested_type_names(
              schema, parent_type, field_name
          )
          # if there are no suggested types perhaps it was a typo?
          suggested_field_names = (
              []
              if suggested_type_names
              else get_suggested_field_names(
                  schema, parent_type, field_name
              )
          )
  
          # report an error including helpful suggestions.
          self.context.report_error(
              GraphQLError(
                  _undefined_field_message(
                      field_name,
                      parent_type.name,
                      suggested_type_names,
                      suggested_field_names,
                  ),
                  [node],
              )
          )
  
file_path: wandb/wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/fields_on_correct_type.py
imports: from collections import Counter
  from ...error import GraphQLError
  from ...pyutils.ordereddict import OrderedDict
  from ...type.definition import GraphQLInterfaceType, GraphQLObjectType, GraphQLUnionType
  from ...utils.quoted_or_list import quoted_or_list
  from ...utils.suggestion_list import suggestion_list
  from .base import ValidationRule
label_desc: Use image node_id 1 for calling the FieldsOnCorrectType obj's underlying member method code with example usage: obj.enter_Field(node, key, parent, path, ancestors) without return types