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

RangeError: Maximum call stack size exceeded on 0.9.6 #35

Closed
lamlv2305 opened this issue Jan 12, 2017 · 3 comments
Closed

RangeError: Maximum call stack size exceeded on 0.9.6 #35

lamlv2305 opened this issue Jan 12, 2017 · 3 comments
Assignees
Labels

Comments

@lamlv2305
Copy link

lamlv2305 commented Jan 12, 2017

I just update my apollo-ios from 0.3.1 to 0.4.2 and apollo-codegen to 0.9.6.

I have 19 *.graphql files with approximate 3k lines. It's quite good on old version, but they have some issue so I have to update.

Then now, I get this error:

apollo-codegen generate **/*.graphql --schema schema.json --output API.swift
RangeError: Maximum call stack size exceeded
at _loop (/usr/local/lib/node_modules/apollo-codegen/src/swift/codeGeneration.js:443:22)
at /usr/local/lib/node_modules/apollo-codegen/src/swift/codeGeneration.js:442:40
at CodeGenerator.withIndent (/usr/local/lib/node_modules/apollo-codegen/src/utilities/CodeGenerator.js:63:5)
at CodeGenerator.withinBlock (/usr/local/lib/node_modules/apollo-codegen/src/utilities/CodeGenerator.js:69:10)
at structDeclaration (/usr/local/lib/node_modules/apollo-codegen/src/swift/language.js:23:13)
at structDeclarationForInputObjectType (/usr/local/lib/node_modules/apollo-codegen/src/swift/codeGeneration.js:437:3)
at typeDeclarationForGraphQLType (/usr/local/lib/node_modules/apollo-codegen/src/swift/codeGeneration.js:412:5)
at /usr/local/lib/node_modules/apollo-codegen/src/swift/codeGeneration.js:48:5
at Array.forEach (native)
at generateSource (/usr/local/lib/node_modules/apollo-codegen/src/swift/codeGeneration.js:47:21)

Did anyone get this isssue and solved it ?

P/s: I'm not english speaking, so sorry for my bad english

@martijnwalraven
Copy link
Contributor

Hmmm is there any chance you can narrow this down?

From the stack trace, it seems like an issue with code generation for an input object. There have been some changes to this recently, so I can see how there might be a bug hiding in there.

I'm not sure how many input objects you have in your schema, but maybe you can try it with a new .graphql file with just the operations that use input objects, see if that results in the same error, and remove them one by one to see which one causes it?

@lamlv2305
Copy link
Author

lamlv2305 commented Jan 12, 2017

That problem on execute:

query getDealFilter($paramInput: DealListInput!) {
    getDealList(input: $paramInput) {
        status
        message
    }
}

And input object from graphql server:

input DealListInput {
    catId: String
    catIdLevel: String
    catleafId: String
    cityId: Int
    curcheckId: Int
    desId: String
    destination: String
    districFilter: String
    isGroup: Boolean
    keyWord: String
    maxPrice: String
    minPrice: String
    pageIndex: Int
    pageSize: Int
    priceFilter: String
    programType: Int
    promotionFilter: String
    sort: Int
}

@martijnwalraven
Copy link
Contributor

martijnwalraven commented Jan 12, 2017

(I've made some changes to the formatting of your comment. Note you can use graphql code blocks in Github Markdown.)

Hmmm, those are a lot of fields. And because they are all optional apollo-codegen will try to generate all permutations of them, so I can see why this breaks... Not sure about the solution though, I need to think about this.

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

No branches or pull requests

2 participants