mirumee / ariadne-graphql-modules

Ariadne package for implementing Ariadne GraphQL schemas using modular approach.
https://ariadnegraphql.org
BSD 3-Clause "New" or "Revised" License
36 stars 4 forks source link

Defined without required GraphQL definition for 'Float' in __requires__ exception #1

Closed kudamhazo closed 2 years ago

kudamhazo commented 2 years ago

I am not sure if this is intended behavior but isn't Float a built-in type of GraphQL that shouldn't require to be passed in as __requires__ attribute of object type class. Here is my object type definition that is failing:

class UomType(ObjectType):
    __schema__ = gql(
        """
        type UnitOfMeasure {
            id: ID!
            code: Int!
            name: String!
            uomType: String
            factorB: Float
            factorC: Float
            remarks: String
            abbrev: String
        }
        """
    )

This fails with error:

ValueError: UomType class was defined without required GraphQL definition for 'Float' in __requires__

rafalp commented 2 years ago

Yup, it is! Float needs to be added to GRAPHQL_TYPES = (...) tuple in dependencies module. Would you like to open PR with fix?

rafalp commented 2 years ago

Released in 0.3.0 🎉