Git Product home page Git Product logo

Comments (12)

patrick91 avatar patrick91 commented on June 10, 2024 1

@ShtykovaAA you can do that using UNSET: https://play.strawberry.rocks/?gist=a70bc1aa74d5d04a6ceea1be6a7b7575

https://strawberry.rocks/docs/types/input-types#defining-input-types

from strawberry.

ShtykovaAA avatar ShtykovaAA commented on June 10, 2024 1

@patrick91 it works! thank you!

from strawberry.

ShtykovaAA avatar ShtykovaAA commented on June 10, 2024

@patrick91 sorry I checked that it doesn't work for @strawberry.experimental.pydantic.input(PydanticModel) and I want to fix it, do I need another conversation?

from strawberry.

patrick91 avatar patrick91 commented on June 10, 2024

@ShtykovaAA cab you make an example in the playground? I think pydantic should work there ☺️

from strawberry.

ShtykovaAA avatar ShtykovaAA commented on June 10, 2024

@patrick91 yes! here an example https://play.strawberry.rocks/?gist=fdff10f784dd786a67d2e74bbab95d77

from strawberry.

ShtykovaAA avatar ShtykovaAA commented on June 10, 2024

@patrick91 I found the place of mistake: https://github.com/graphql-python/graphql-core/blob/main/src/graphql/utilities/coerce_input_value.py#L102
So if I'm using strawberry.input the default value is Undefined, but than I'm using @strawberry.experimental.pydantic.input(PydanticModel) the default value is None...

from strawberry.

patrick91 avatar patrick91 commented on June 10, 2024

@ShtykovaAA thanks for checking! I might have some time to fix this during the weekend, or feel free to send a PR if you find a way to fix it!

from strawberry.

ShtykovaAA avatar ShtykovaAA commented on June 10, 2024

@patrick91 I'm newbie but I really want to take a chance

I think we need to check this condition https://github.com/strawberry-graphql/strawberry/blob/main/strawberry/experimental/pydantic/object_type.py#L76 because it means that we are overwriting our strawberry.input by PydanticField and that's why the default value is None, but not UNSET.

what do you think about it? I think it's a big change in project, but I think that it's supposed to be like that

from strawberry.

patrick91 avatar patrick91 commented on June 10, 2024

@ShtykovaAA I'm not too sure! Feel free to try and send a draft PR, we should have enough test to make sure this becomes a valid change 😊

from strawberry.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.