title: GraphQL + Relay + Graphene
body: <pre><code>class Product(SQLAlchemyObjectType):
      class Meta:
          model = ProductModel
          interfaces = (relay.Node, )
  
      @classmethod
      def get_node(cls, id, context, info):
          #must implement to relay
          pass
  
  
  class Query(graphene.ObjectType):
      product = graphene.Field(Product, id=graphene.String())
      node = relay.Node.Field()
  
      def resolve_product(self, args, context, info):
          session =  context['session']
          id_ = from_global_id(args['id'])[1]
          p = session.query(ProductModel).filter(ProductModel.id == id_).first()
          return p
  </code></pre>
  
  <p>I am trying to use GraphQL + Relay + Grephene. But I am a little bit confused. Can I support both queries using relay? Or when implementing realy I will only support the second one?</p>
  
  <p>Do I always need to translate the globalId to database primary key?</p>
  
  <p>Graph QL:</p>
  
  <pre><code>{
      product (id: "XYZ"){
         id
         title
      }
  }
  </code></pre>
  
  <p>Relay:</p>
  
  <pre><code>{
          node(id: "XYZ") {
            id
            ... on product {
              title
            }
          }
  </code></pre>