4

Currently the documentation in Graphene-Python on Custom Scalar does not provide proper context on how these methods are called, or atleast what are the difference between these staticmethods?

I can see that each method intends to display the object. Well on serializer method this is pretty straightforward.

All method accept argument and display value. As for me a beginner I could not comprehend how to use this method properly.

class DateTime(Scalar):
    '''DateTime Scalar Description'''

    @staticmethod
    def serialize(dt):
        # omitted

    @staticmethod
    def parse_literal(node):
        # omitted

    @staticmethod
    def parse_value(value):
        # omitted

It would be nice to have a proper explanation or context on how to use these methods.

Hopefully some of you could share knowledge and enlighten us how to implement custom scalar.

Roel
  • 6,512
  • 10
  • 59
  • 100

0 Answers0