Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaks with custom scalars #13

Closed
Meemaw opened this issue Mar 25, 2023 · 8 comments
Closed

Breaks with custom scalars #13

Meemaw opened this issue Mar 25, 2023 · 8 comments

Comments

@Meemaw
Copy link

Meemaw commented Mar 25, 2023

Version 3.1.0 breaks with custom scalars.

To reproduce:

class AddressScalar(Scalar):
    base = String

    @staticmethod
    def coerce_address(value: Any):
        ...

    serialize = coerce_address
    parse_value = coerce_address

    @staticmethod
    def parse_literal(ast):
        ...


class Query(ObjectType):
    test = String(x=AddressScalar())


schema = build_schema(query=Query)
@patrick91
Copy link
Member

@Meemaw can you post the error? 😊

@arunsureshkumar
Copy link
Collaborator

arunsureshkumar commented Mar 25, 2023

@Meemaw can you post the error? 😊

@patrick91 - This issue will be resolved in the #14 along with other few issues related to Compound keys as well.

@Meemaw
Copy link
Author

Meemaw commented Mar 27, 2023

It seems 3.1.1 still breaks with custom enums cc @arunsureshkumar @patrick91

  File "/runner/_work/xx/.venv/lib/python3.11/site-packages/graphene_federation/utils.py", line 98, in get_attributed_fields
    for field in list(type_.graphene_type._meta.fields):
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'EnumOptions' object has no attribute 'fields'

@patrick91
Copy link
Member

@arunsureshkumar do you have time to check at this error too? :)

@arunsureshkumar
Copy link
Collaborator

@arunsureshkumar do you have time to check at this error too? :)

Sure!

@arunsureshkumar
Copy link
Collaborator

#15 - @patrick91 Please review.

@patrick91
Copy link
Member

@Meemaw should be fixed in v3.1.2 :)

@patrick91
Copy link
Member

sorry, it should be 3.1.3, I forgot to update the version in setup.py 🤦

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants