code: def validate(self):
          
          if not isinstance(self.location, Location):
              raise TypeError(u'Expected Location location, got: {} {}'.format(
                  type(self.location).__name__, self.location))
  
          if not self.location.field:
              raise ValueError(u'Expected Location object that points to a field, got: '
                               u'{}'.format(self.location))
  
          if not is_graphql_type(self.field_type):
              raise ValueError(u'Invalid value of "field_type": {}'.format(self.field_type))
  
          stripped_field_type = strip_non_null_from_type(self.field_type)
          if isinstance(stripped_field_type, GraphQLList):
              inner_type = strip_non_null_from_type(stripped_field_type.of_type)
              if GraphQLDate.is_same_type(inner_type) or GraphQLDateTime.is_same_type(inner_type):
                  # This is a compilation error rather than a ValueError as
                  # it can be caused by an invalid GraphQL query on an otherwise valid schema.
                  # In other words, it's an error in writing the GraphQL query, rather than
                  # a programming error within the library.
                  raise GraphQLCompilationError(
                      u'Lists of Date or DateTime cannot currently be represented as '
                      u'OutputContextField objects: {}'.format(self.field_type))
docs: Validate that the OutputContextField is correctly representable.