Giter Site home page Giter Site logo

type.getFields strikes again about gql2ts HOT 15 CLOSED

amount avatar amount commented on August 18, 2024
type.getFields strikes again

from gql2ts.

Comments (15)

brettjurgens avatar brettjurgens commented on August 18, 2024 1

makes sense, i'll loosen the version restriction in gql2ts

from gql2ts.

voxmatt avatar voxmatt commented on August 18, 2024 1

awesome, thanks for the quick work

from gql2ts.

voxmatt avatar voxmatt commented on August 18, 2024

Thanks for the quick reply!

from gql2ts.

brettjurgens avatar brettjurgens commented on August 18, 2024

@voxmatt can you try installing 1.5.0-alpha.90415fad and see if that works?

from gql2ts.

voxmatt avatar voxmatt commented on August 18, 2024

Just tried, still getting:

/Users/mtm/clockwise/src/client-web/webapp/node_modules/@gql2ts/from-schema/dist/index.js:118
        if (isInputField(field) || !field.args.length) {
                                               ^

TypeError: Cannot read property 'length' of undefined
    at generateArgumentsDeclaration (/Users/mtm/clockwise/src/client-web/webapp/node_modules/@gql2ts/from-schema/dist/index.js:118:48)

package.json: "gql2ts": "1.5.0-alpha.90415fad",

from gql2ts.

brettjurgens avatar brettjurgens commented on August 18, 2024

@voxmatt ahh that's a bug in master that i'm fixing right now. let me cherry-pick that into an earlier version and publish.

from gql2ts.

brettjurgens avatar brettjurgens commented on August 18, 2024

@voxmatt ok, can you try 1.5.0-alpha.51c55d43, which is v1.4.3 + #152

from gql2ts.

voxmatt avatar voxmatt commented on August 18, 2024

Sorry @brettjurgens, still errors:

$ GRAPHQL_NO_NAME_WARNING=true gql2ts -n ISchema -i Node -o src/declarations/schema.d.ts build-util/schema.json --legacy
/Users/mtm/clockwise/src/client-web/webapp/node_modules/@gql2ts/from-schema/dist/index.js:118
        if (isInputField(field) || !field.args.length) {
                                               ^

TypeError: Cannot read property 'length' of undefined
    at generateArgumentsDeclaration (/Users/mtm/clockwise/src/client-web/webapp/node_modules/@gql2ts/from-schema/dist/index.js:118:48)
    at filteredFields.map.field (/Users/mtm/clockwise/src/client-web/webapp/node_modules/@gql2ts/from-schema/dist/index.js:170:44)
    at Array.map (<anonymous>)
    at typeToInterface (/Users/mtm/clockwise/src/client-web/webapp/node_modules/@gql2ts/from-schema/dist/index.js:170:31)
    at typeArr.filter.filter.map.type (/Users/mtm/clockwise/src/client-web/webapp/node_modules/@gql2ts/from-schema/dist/index.js:198:10)
    at Array.map (<anonymous>)
    at typesToInterfaces (/Users/mtm/clockwise/src/client-web/webapp/node_modules/@gql2ts/from-schema/dist/index.js:197:14)
    at run (/Users/mtm/clockwise/src/client-web/webapp/node_modules/@gql2ts/from-schema/dist/index.js:204:12)
    at Object.exports.schemaToInterfaces (/Users/mtm/clockwise/src/client-web/webapp/node_modules/@gql2ts/from-schema/dist/index.js:206:73)
    at Object.exports.generateNamespace (/Users/mtm/clockwise/src/client-web/webapp/node_modules/@gql2ts/from-schema/dist/index.js:209:85)

from gql2ts.

brettjurgens avatar brettjurgens commented on August 18, 2024

@voxmatt can you make sure that @gql2ts/from-schema is at 1.5.0-alpha.51c55d43? that code shouldn't exist in that release (see: https://unpkg.com/@gql2ts/[email protected]/dist/index.js)

from gql2ts.

voxmatt avatar voxmatt commented on August 18, 2024

yep, verified. node_modules/gql2ts/package.json

{
  "_from": "[email protected]",
  "_id": "[email protected]",
  "_inBundle": false,
  "_integrity": "sha512-QVLePajCPyVEEUXy808/VD9SvjeEEnQMt6MxD9CxAtaCHsHnJwG8l8BEwd1ITD2tvQny3DIBNRq7SZFDgqU+Qw==",
  "_location": "/gql2ts",
  "_phantomChildren": {},
  "_requested": {
    "type": "version",
    "registry": true,
    "raw": "[email protected]",
    "name": "gql2ts",
    "escapedName": "gql2ts",
    "rawSpec": "1.5.0-alpha.51c55d43",
    "saveSpec": null,
    "fetchSpec": "1.5.0-alpha.51c55d43"
  },

Error is:

> GRAPHQL_NO_NAME_WARNING=true gql2ts -n ISchema -i Node -o src/declarations/schema.d.ts build-util/schema.json --legacy

/Users/mtm/clockwise/src/client-web/webapp/node_modules/@gql2ts/from-schema/dist/index.js:118
        if (isInputField(field) || !field.args.length) {
                                               ^

TypeError: Cannot read property 'length' of undefined
    at generateArgumentsDeclaration (/Users/mtm/clockwise/src/client-web/webapp/node_modules/@gql2ts/from-schema/dist/index.js:118:48)
    at filteredFields.map.field (/Users/mtm/clockwise/src/client-web/webapp/node_modules/@gql2ts/from-schema/dist/index.js:170:44)
    at Array.map (<anonymous>)
    at typeToInterface (/Users/mtm/clockwise/src/client-web/webapp/node_modules/@gql2ts/from-schema/dist/index.js:170:31)
    at typeArr.filter.filter.map.type (/Users/mtm/clockwise/src/client-web/webapp/node_modules/@gql2ts/from-schema/dist/index.js:198:10)
    at Array.map (<anonymous>)
    at typesToInterfaces (/Users/mtm/clockwise/src/client-web/webapp/node_modules/@gql2ts/from-schema/dist/index.js:197:14)
    at run (/Users/mtm/clockwise/src/client-web/webapp/node_modules/@gql2ts/from-schema/dist/index.js:204:12)
    at Object.exports.schemaToInterfaces (/Users/mtm/clockwise/src/client-web/webapp/node_modules/@gql2ts/from-schema/dist/index.js:206:73)
    at Object.exports.generateNamespace (/Users/mtm/clockwise/src/client-web/webapp/node_modules/@gql2ts/from-schema/dist/index.js:209:85)

from gql2ts.

brettjurgens avatar brettjurgens commented on August 18, 2024

@voxmatt that's for gql2ts, can you check @gql2ts/from-schema which is a dependency of gql2ts. alternatively clear node_modules and re-install

from gql2ts.

voxmatt avatar voxmatt commented on August 18, 2024

@brettjurgens sorry, yes, there is a mismatch.

In my package.json I have "gql2ts": "1.5.0-alpha.51c55d43",

But diving into @gql2ts/from-schema shows "version": "1.5.0-alpha.cec79414",

from gql2ts.

brettjurgens avatar brettjurgens commented on August 18, 2024

makes sense, can you clear that old version and install the later one?

i think that happens because cec79414 > 51c55d43 even though 51c55d43 is more recent

from gql2ts.

voxmatt avatar voxmatt commented on August 18, 2024

okay, sorry about that, there was a little weirdness with yarn holding onto the old packages, but all seems to work now. Thanks!!

from gql2ts.

brettjurgens avatar brettjurgens commented on August 18, 2024

cool, just published 1.4.4 which is identical 51c55d43, closing this out

from gql2ts.

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.