title: Graphene: How to add a function before query execute?
body: <p>Is there a way to execute a function before all query?</p>
  <p>When I add an annotation above Query class, It makes an error</p>
  <pre><code>AssertionError: Type &lt;function Query at 0x104d1dd30&gt; is not a valid ObjectType.
  
  
  def my_func(f):
      @wraps(f)
      def my_func_wrap(*args, **kwargs):
          //do something
          return f(*args, **kwargs)
  
      return my_func_wrap
  
  @my_func
  class Query(graphene.ObjectType):
      node = relay.Node.Field()
  
      users = graphene.List(lambda: UserSchema)
  
      def resolve_users(self, info):
          //do something
          return User.query.all()
  
  
  schema = graphene.Schema(query=Query)
  </code></pre>
  <p>If i add the annotation to every resolver, It works fine.</p>
  <p>but I will add more than 20 resolvers and I don't think adding the annotation to every resolver is good idea.</p>