Relay: 1.5.0-rc.1 - Maximum call stack size exceeded.

Created on 21 Jan 2018  路  9Comments  路  Source: facebook/relay

Maximum call stack size exceeded.

The previous version works well.

$ rimraf **/__generated__ && relay-compiler --exclude '**/node_modules/**' '**/__mocks__/**' '**/__tests__/**' '**/__generated__/**' '**/flow-typed/**' --src ./ --schema schema.graphql
HINT: pass --watch to keep watching for changes.

Writing default
ERROR:
Error writing modules:
RangeError: Maximum call stack size exceeded
    at isStrictModeReservedWordES6 (/Users/steida/dev/este/node_modules/esutils/lib/keyword.js:30:41)
    at isKeywordES6 (/Users/steida/dev/este/node_modules/esutils/lib/keyword.js:55:23)
    at Object.isReservedWordES6 (/Users/steida/dev/este/node_modules/esutils/lib/keyword.js:90:68)
    at Object.isValidIdentifier (/Users/steida/dev/este/node_modules/babel-types/lib/validators.js:167:61)
    at Object.validate (/Users/steida/dev/este/node_modules/babel-types/lib/definitions/core.js:295:16)
    at validate (/Users/steida/dev/este/node_modules/babel-types/lib/index.js:505:9)
    at Object.builder (/Users/steida/dev/este/node_modules/babel-types/lib/index.js:466:7)
    at /Users/steida/dev/este/node_modules/relay-compiler/bin/relay-compiler:7870:88
    at Array.map (<anonymous>)
    at transformNonNullableInputType (/Users/steida/dev/este/node_modules/relay-compiler/bin/relay-compiler:7869:9)
error Command failed with exit code 100.

Most helpful comment

sounds good, in that case i'll merge this into #1740

All 9 comments

Also, https://github.com/flowtype/flow-typed is missing with 1.5rc

thanks @steida ! I'll try to make some time to look into #2142. Curious, do you know if this is the same issue as the one addressed in #2142? Or is this a different call stack error?

It looks like. But with Relay 1.4.1 the same GraphQL worked for me, so I am not sure. Btw, this means Relay can't be used with awesome graphcool service at the moment. graphcool generates block comments which does not work with 1.4.1 and, 1.5rc fails on aforementioned bug.

Schema may help.

# source: https://api.graph.cool/relay/v1/cj9dlwn7x1s9s01572c1qfriu
# timestamp: Sun Jan 21 2018 03:16:14 GMT+0100 (CET)

type AddToUserWebsPayload {
  viewer: Viewer!
  clientMutationId: String!
  ownerUser: User
  websWeb: Web
  ownerUserEdge: UserEdge
  websWebEdge: WebEdge
}

input AddToUserWebsUserInput {
  websWebId: ID!
  ownerUserId: ID!
  clientMutationId: String!
}

"""AuthenticateUserPayload"""
type AuthenticateUserPayload {
  id: ID!
  token: String!
}

input CreateUser {
  email: String
  password: String
  websIds: [ID!]
  webs: [UserwebsWeb!]
}

"""
If authentication was successful the payload contains the user and a token. If unsuccessful this payload is null.
"""
type CreateUserPayload {
  user: User
  clientMutationId: String
  viewer: Viewer!
}

input CreateWeb {
  domain: String!
  name: String!
  ownerId: ID
  owner: WebownerUser
}

input CreateWebInput {
  domain: String!
  name: String!
  ownerId: ID
  owner: WebownerUser
  clientMutationId: String!
}

type CreateWebPayload {
  viewer: Viewer!
  clientMutationId: String!
  web: Web
  edge: WebEdge
  owner: User
}

scalar DateTime

input DeleteUserInput {
  id: ID!
  clientMutationId: String!
}

type DeleteUserPayload {
  viewer: Viewer!
  clientMutationId: String!
  user: User
  edge: UserEdge
  deletedId: ID
}

input DeleteWebInput {
  id: ID!
  clientMutationId: String!
}

type DeleteWebPayload {
  viewer: Viewer!
  clientMutationId: String!
  web: Web
  edge: WebEdge
  owner: User
  deletedId: ID
}

"""LoggedInUserPayload"""
type LoggedInUserPayload {
  id: ID!
}

type Mutation {
  createWeb(input: CreateWebInput!): CreateWebPayload
  updateUser(input: UpdateUserInput!): UpdateUserPayload
  updateWeb(input: UpdateWebInput!): UpdateWebPayload
  updateOrCreateUser(input: UpdateOrCreateUserInput!): UpdateOrCreateUserPayload
  updateOrCreateWeb(input: UpdateOrCreateWebInput!): UpdateOrCreateWebPayload
  deleteUser(input: DeleteUserInput!): DeleteUserPayload
  deleteWeb(input: DeleteWebInput!): DeleteWebPayload
  addToUserWebs(input: AddToUserWebsUserInput!): AddToUserWebsPayload
  createUser(input: SignupUserInput!): CreateUserPayload!

  """authenticate"""
  authenticateUser(email: String!, password: String!): AuthenticateUserPayload

  """signup"""
  signupUser(email: String!, password: String!): SignupUserPayload
}

"""An object with an ID"""
interface Node {
  """The id of the object."""
  id: ID!
}

"""Information about pagination in a connection."""
type PageInfo {
  """When paginating forwards, are there more items?"""
  hasNextPage: Boolean!

  """When paginating backwards, are there more items?"""
  hasPreviousPage: Boolean!

  """When paginating backwards, the cursor to continue."""
  startCursor: String

  """When paginating forwards, the cursor to continue."""
  endCursor: String
}

type Query {
  viewer: Viewer!

  """Fetches an object given its ID"""
  node(
    """The ID of an object"""
    id: ID!
  ): Node
}

input SignupUserInput {
  email: String
  password: String
  websIds: [ID!]
  webs: [UserwebsWeb!]
  clientMutationId: String!
}

"""SignupUserPayload"""
type SignupUserPayload {
  id: ID!
  token: String!
}

input UpdateOrCreateUserInput {
  update: UpdateUser!
  create: CreateUser!
  clientMutationId: String!
}

type UpdateOrCreateUserPayload {
  viewer: Viewer!
  clientMutationId: String!
  user: User
  edge: UserEdge
}

input UpdateOrCreateWebInput {
  update: UpdateWeb!
  create: CreateWeb!
  clientMutationId: String!
}

type UpdateOrCreateWebPayload {
  viewer: Viewer!
  clientMutationId: String!
  web: Web
  edge: WebEdge
  owner: User
}

input UpdateUser {
  email: String
  id: ID!
  password: String
  websIds: [ID!]
  webs: [UserwebsWeb!]
}

input UpdateUserInput {
  email: String
  id: ID!
  password: String
  websIds: [ID!]
  webs: [UserwebsWeb!]
  clientMutationId: String!
}

type UpdateUserPayload {
  viewer: Viewer!
  clientMutationId: String!
  user: User
  edge: UserEdge
}

input UpdateWeb {
  domain: String
  id: ID!
  name: String
  ownerId: ID
  owner: WebownerUser
}

input UpdateWebInput {
  domain: String
  id: ID!
  name: String
  ownerId: ID
  owner: WebownerUser
  clientMutationId: String!
}

type UpdateWebPayload {
  viewer: Viewer!
  clientMutationId: String!
  web: Web
  edge: WebEdge
  owner: User
}

type User implements Node {
  createdAt: DateTime!
  email: String
  id: ID!
  password: String
  updatedAt: DateTime!
  webs(filter: WebFilter, orderBy: WebOrderBy, skip: Int, after: String, before: String, first: Int, last: Int): WebConnection
}

"""A connection to a list of items."""
type UserConnection {
  """Information to aid in pagination."""
  pageInfo: PageInfo!

  """A list of edges."""
  edges: [UserEdge]

  """Count of filtered result set without considering pagination arguments"""
  count: Int!
}

"""An edge in a connection."""
type UserEdge {
  """The item at the end of the edge."""
  node: User!

  """A cursor for use in pagination."""
  cursor: String!
}

input UserFilter {
  """Logical AND on all given filters."""
  AND: [UserFilter!]

  """Logical OR on all given filters."""
  OR: [UserFilter!]
  createdAt: DateTime

  """All values that are not equal to given value."""
  createdAt_not: DateTime

  """All values that are contained in given list."""
  createdAt_in: [DateTime!]

  """All values that are not contained in given list."""
  createdAt_not_in: [DateTime!]

  """All values less than the given value."""
  createdAt_lt: DateTime

  """All values less than or equal the given value."""
  createdAt_lte: DateTime

  """All values greater than the given value."""
  createdAt_gt: DateTime

  """All values greater than or equal the given value."""
  createdAt_gte: DateTime
  email: String

  """All values that are not equal to given value."""
  email_not: String

  """All values that are contained in given list."""
  email_in: [String!]

  """All values that are not contained in given list."""
  email_not_in: [String!]

  """All values less than the given value."""
  email_lt: String

  """All values less than or equal the given value."""
  email_lte: String

  """All values greater than the given value."""
  email_gt: String

  """All values greater than or equal the given value."""
  email_gte: String

  """All values containing the given string."""
  email_contains: String

  """All values not containing the given string."""
  email_not_contains: String

  """All values starting with the given string."""
  email_starts_with: String

  """All values not starting with the given string."""
  email_not_starts_with: String

  """All values ending with the given string."""
  email_ends_with: String

  """All values not ending with the given string."""
  email_not_ends_with: String
  id: ID

  """All values that are not equal to given value."""
  id_not: ID

  """All values that are contained in given list."""
  id_in: [ID!]

  """All values that are not contained in given list."""
  id_not_in: [ID!]

  """All values less than the given value."""
  id_lt: ID

  """All values less than or equal the given value."""
  id_lte: ID

  """All values greater than the given value."""
  id_gt: ID

  """All values greater than or equal the given value."""
  id_gte: ID

  """All values containing the given string."""
  id_contains: ID

  """All values not containing the given string."""
  id_not_contains: ID

  """All values starting with the given string."""
  id_starts_with: ID

  """All values not starting with the given string."""
  id_not_starts_with: ID

  """All values ending with the given string."""
  id_ends_with: ID

  """All values not ending with the given string."""
  id_not_ends_with: ID
  password: String

  """All values that are not equal to given value."""
  password_not: String

  """All values that are contained in given list."""
  password_in: [String!]

  """All values that are not contained in given list."""
  password_not_in: [String!]

  """All values less than the given value."""
  password_lt: String

  """All values less than or equal the given value."""
  password_lte: String

  """All values greater than the given value."""
  password_gt: String

  """All values greater than or equal the given value."""
  password_gte: String

  """All values containing the given string."""
  password_contains: String

  """All values not containing the given string."""
  password_not_contains: String

  """All values starting with the given string."""
  password_starts_with: String

  """All values not starting with the given string."""
  password_not_starts_with: String

  """All values ending with the given string."""
  password_ends_with: String

  """All values not ending with the given string."""
  password_not_ends_with: String
  updatedAt: DateTime

  """All values that are not equal to given value."""
  updatedAt_not: DateTime

  """All values that are contained in given list."""
  updatedAt_in: [DateTime!]

  """All values that are not contained in given list."""
  updatedAt_not_in: [DateTime!]

  """All values less than the given value."""
  updatedAt_lt: DateTime

  """All values less than or equal the given value."""
  updatedAt_lte: DateTime

  """All values greater than the given value."""
  updatedAt_gt: DateTime

  """All values greater than or equal the given value."""
  updatedAt_gte: DateTime
  webs_every: WebFilter
  webs_some: WebFilter
  webs_none: WebFilter
}

enum UserOrderBy {
  createdAt_ASC
  createdAt_DESC
  email_ASC
  email_DESC
  id_ASC
  id_DESC
  password_ASC
  password_DESC
  updatedAt_ASC
  updatedAt_DESC
}

input UserwebsWeb {
  domain: String!
  name: String!
}

"""This is the famous Relay viewer object"""
type Viewer {
  allUsers(filter: UserFilter, orderBy: UserOrderBy, skip: Int, after: String, before: String, first: Int, last: Int): UserConnection!
  allWebs(filter: WebFilter, orderBy: WebOrderBy, skip: Int, after: String, before: String, first: Int, last: Int): WebConnection!
  user: User
  User(email: String, id: ID): User
  Web(domain: String, id: ID): Web

  """loggedInUser"""
  loggedInUser: LoggedInUserPayload
  id: ID!
}

type Web implements Node {
  createdAt: DateTime!
  domain: String!
  id: ID!
  name: String!
  owner(filter: UserFilter): User!
  updatedAt: DateTime!
}

"""A connection to a list of items."""
type WebConnection {
  """Information to aid in pagination."""
  pageInfo: PageInfo!

  """A list of edges."""
  edges: [WebEdge]

  """Count of filtered result set without considering pagination arguments"""
  count: Int!
}

"""An edge in a connection."""
type WebEdge {
  """The item at the end of the edge."""
  node: Web!

  """A cursor for use in pagination."""
  cursor: String!
}

input WebFilter {
  """Logical AND on all given filters."""
  AND: [WebFilter!]

  """Logical OR on all given filters."""
  OR: [WebFilter!]
  createdAt: DateTime

  """All values that are not equal to given value."""
  createdAt_not: DateTime

  """All values that are contained in given list."""
  createdAt_in: [DateTime!]

  """All values that are not contained in given list."""
  createdAt_not_in: [DateTime!]

  """All values less than the given value."""
  createdAt_lt: DateTime

  """All values less than or equal the given value."""
  createdAt_lte: DateTime

  """All values greater than the given value."""
  createdAt_gt: DateTime

  """All values greater than or equal the given value."""
  createdAt_gte: DateTime
  domain: String

  """All values that are not equal to given value."""
  domain_not: String

  """All values that are contained in given list."""
  domain_in: [String!]

  """All values that are not contained in given list."""
  domain_not_in: [String!]

  """All values less than the given value."""
  domain_lt: String

  """All values less than or equal the given value."""
  domain_lte: String

  """All values greater than the given value."""
  domain_gt: String

  """All values greater than or equal the given value."""
  domain_gte: String

  """All values containing the given string."""
  domain_contains: String

  """All values not containing the given string."""
  domain_not_contains: String

  """All values starting with the given string."""
  domain_starts_with: String

  """All values not starting with the given string."""
  domain_not_starts_with: String

  """All values ending with the given string."""
  domain_ends_with: String

  """All values not ending with the given string."""
  domain_not_ends_with: String
  id: ID

  """All values that are not equal to given value."""
  id_not: ID

  """All values that are contained in given list."""
  id_in: [ID!]

  """All values that are not contained in given list."""
  id_not_in: [ID!]

  """All values less than the given value."""
  id_lt: ID

  """All values less than or equal the given value."""
  id_lte: ID

  """All values greater than the given value."""
  id_gt: ID

  """All values greater than or equal the given value."""
  id_gte: ID

  """All values containing the given string."""
  id_contains: ID

  """All values not containing the given string."""
  id_not_contains: ID

  """All values starting with the given string."""
  id_starts_with: ID

  """All values not starting with the given string."""
  id_not_starts_with: ID

  """All values ending with the given string."""
  id_ends_with: ID

  """All values not ending with the given string."""
  id_not_ends_with: ID
  name: String

  """All values that are not equal to given value."""
  name_not: String

  """All values that are contained in given list."""
  name_in: [String!]

  """All values that are not contained in given list."""
  name_not_in: [String!]

  """All values less than the given value."""
  name_lt: String

  """All values less than or equal the given value."""
  name_lte: String

  """All values greater than the given value."""
  name_gt: String

  """All values greater than or equal the given value."""
  name_gte: String

  """All values containing the given string."""
  name_contains: String

  """All values not containing the given string."""
  name_not_contains: String

  """All values starting with the given string."""
  name_starts_with: String

  """All values not starting with the given string."""
  name_not_starts_with: String

  """All values ending with the given string."""
  name_ends_with: String

  """All values not ending with the given string."""
  name_not_ends_with: String
  updatedAt: DateTime

  """All values that are not equal to given value."""
  updatedAt_not: DateTime

  """All values that are contained in given list."""
  updatedAt_in: [DateTime!]

  """All values that are not contained in given list."""
  updatedAt_not_in: [DateTime!]

  """All values less than the given value."""
  updatedAt_lt: DateTime

  """All values less than or equal the given value."""
  updatedAt_lte: DateTime

  """All values greater than the given value."""
  updatedAt_gt: DateTime

  """All values greater than or equal the given value."""
  updatedAt_gte: DateTime
  owner: UserFilter
}

enum WebOrderBy {
  createdAt_ASC
  createdAt_DESC
  domain_ASC
  domain_DESC
  id_ASC
  id_DESC
  name_ASC
  name_DESC
  updatedAt_ASC
  updatedAt_DESC
}

input WebownerUser {
  email: String
  password: String
  websIds: [ID!]
  webs: [UserwebsWeb!]
}

Is there a recursive type in this schema? Could you try applying the fix from #2142 to confirm if it is fixed with that patch? Thanks!

Yep. It fixed my issue. I applied it to the master. It's weird, that previous version didn't fail, but I am happy it fixes my issue.

sounds good, in that case i'll merge this into #1740

Was this page helpful?
0 / 5 - 0 ratings

Related issues

HsuTing picture HsuTing  路  3Comments

amccloud picture amccloud  路  3Comments

brad-decker picture brad-decker  路  3Comments

rayronvictor picture rayronvictor  路  3Comments

luongthanhlam picture luongthanhlam  路  3Comments