Giter VIP home page Giter VIP logo

Comments (9)

beepsoft avatar beepsoft commented on August 19, 2024

I run into the same issue. It seems that resolveFieldsAndImports() in generate.js explicitly filters out fields with arguments.

.filter(field => field.args.length === 0)

Is this necessary, is there any reason for this behaviour? If so, then can this be made optional?

from mst-gql.

chrisdrackett avatar chrisdrackett commented on August 19, 2024

I'm not sure if there is a reason behind this (@mweststrate?) and haven't had a chance to dig in myself yet.

from mst-gql.

beepsoft avatar beepsoft commented on August 19, 2024

Until someone can clarify this I added a --allowFieldArgs option to the generator and created a pull request in case this turns out to be useful.

from mst-gql.

chrisdrackett avatar chrisdrackett commented on August 19, 2024

@beepsoft does it seem to work without issue with args?

from mst-gql.

beepsoft avatar beepsoft commented on August 19, 2024

Yes, in my app it seems to generate the approriate definitions and when querying via the store it fills these properties correctly. In my cases these are arrays of objects. If the type is specified as root with --root Foo

then I get

bar: types.optional(types.array(MSTGQLRef(types.late(() => FooModel))), [])

otherwise

bar: types.optional(types.array(types.late(() => FooModel)), [])

I think that's how it is supposed to work.

from mst-gql.

chrisdrackett avatar chrisdrackett commented on August 19, 2024

If this is the case I see no reason not to make it the default :)

from mst-gql.

beepsoft avatar beepsoft commented on August 19, 2024

Yep. :-)

from mst-gql.

beepsoft avatar beepsoft commented on August 19, 2024

@chrisdrackett Can you please fix this by deleting that filter line?

from mst-gql.

chrisdrackett avatar chrisdrackett commented on August 19, 2024

Iā€™m currently out of town. The earliest I could get to it is Tuesday.

from mst-gql.

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.