Home > Mobile >  Graphene without Django ORM models
Graphene without Django ORM models

Time:09-21

what is best practise to integrate Graphene-Django with my Redshift tables without using DjangoObjectType conversion of django model as 1st step, which I don't have in my case.

How I can bind these tables with Graphene in schema.py.

class CategoryType(DjangoObjectType):
    class Meta:
        model = Category
        fields = ("id", "name")

CodePudding user response:

You have to implement ObjectType from Graphene, not DjangoObjectType. Then indicate your Redshift fields from category table.

import ObjectType from graphene

class CategoryType(ObjectType):
    id = ... 
    name = ...
  • Related