code: def vertex_field_only(operator):
      
      def decorator(f):
          """Decorate the supplied function with the "vertex_field_only" logic."""
          @wraps(f)
          def wrapper(filter_operation_info, context, parameters, *args, **kwargs):
              """Check that the type on which the operator operates is a vertex field type."""
              if 'operator' in kwargs:
                  current_operator = kwargs['operator']
              else:
                  # Because "operator" is from an enclosing scope, it is immutable in Python 2.x.
                  current_operator = operator
  
              if not is_vertex_field_type(filter_operation_info.field_type):
                  raise GraphQLCompilationError(
                      u'Cannot apply "{}" filter to non-vertex field: '
                      u'{}'.format(current_operator, filter_operation_info.field_name))
              return f(filter_operation_info, context, parameters, *args, **kwargs)
  
          return wrapper
  
      return decorator
docs: Ensure the filter function is only applied to vertex field types.