meteor-graphql icon indicating copy to clipboard operation
meteor-graphql copied to clipboard

If I have 2 .graphql schemas that import each other:

Open theodorDiaconu opened this issue 7 years ago • 3 comments
trafficstars

This is a very common scenario:

// Comment.graphql
#import './User'

type Comment {
  title: String!
  isDone: Boolean!
  createdAt: Date!
  user: User
}

// User.graphql
#import './Comment'

type User {
  _id: ID!
  firstName: String!
  lastName: String!
  age: Int
  comments: [Comment]
}

Fails with:

W20180310-07:05:55.673(2)? (STDERR) TypeError: Cannot read property 'filter' of undefined
W20180310-07:05:55.673(2)? (STDERR)     at unique (/Users/theodor/Projects/graphql-live/.meteor/local/build/programs/server/app/app.js:30:19)
W20180310-07:05:55.673(2)? (STDERR)     at Comment.graphql.js (/Users/theodor/Projects/graphql-live/.meteor/local/build/programs/server/app/app.js:43:44)
W20180310-07:05:55.673(2)? (STDERR)     at fileEvaluate (packages/modules-runtime.js:343:9)
W20180310-07:05:55.674(2)? (STDERR)     at require (packages/modules-runtime.js:238:16)

theodorDiaconu avatar Mar 10 '18 05:03 theodorDiaconu

I have the same error. Could you share your solve?

thearabbit avatar Aug 21 '19 13:08 thearabbit

I try remove #import './User', It still work fine. Don't understand???

thearabbit avatar Aug 22 '19 09:08 thearabbit

+1 have any solve this problem???

thearabbit avatar Apr 11 '20 02:04 thearabbit