import graphene
from .models import Offer
from . import types


class Query(graphene.ObjectType):
    all_offers = graphene.List(types.Offer)

    def resolve_all_offers(self, info):
        return Offer.objects.all()

import graphene
from .models import Offer
from . import types


class Query(graphene.ObjectType):
    all_offers = graphene.List(types.Offer)

    def resolve_all_offers(self, info):
        return Offer.objects.order_by('company_name').all()

Order offers by company name
Order offers by company name

Closes #373

  import graphene
  from .models import Offer
  from . import types
  
  
  class Query(graphene.ObjectType):
      all_offers = graphene.List(types.Offer)
  
      def resolve_all_offers(self, info):
-         return Offer.objects.all()
+         return Offer.objects.order_by('company_name').all()
  
Order offers by company name
## Code Before:
import graphene
from .models import Offer
from . import types


class Query(graphene.ObjectType):
    all_offers = graphene.List(types.Offer)

    def resolve_all_offers(self, info):
        return Offer.objects.all()

## Instruction:
Order offers by company name
## Code After:
import graphene
from .models import Offer
from . import types


class Query(graphene.ObjectType):
    all_offers = graphene.List(types.Offer)

    def resolve_all_offers(self, info):
        return Offer.objects.order_by('company_name').all()
