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

1-getting-started schema error with graphcool init #6

Open
GordanRatkovic opened this issue Dec 20, 2017 · 3 comments
Open

1-getting-started schema error with graphcool init #6

GordanRatkovic opened this issue Dec 20, 2017 · 3 comments

Comments

@GordanRatkovic
Copy link

(Using graphcool 0.4)
After running:
graphcool init --schema https://graphqlbin.com/hn-relay.graphql --name Hackernews
I run into this error:
The relation field links has the wrong format: [Link!] Possible Formats: Link, Link!, [Link!]!

I created a local copy of hn-relay.graphql and replaced [Link!] with [Link!]! as well as [Vote!] with [Vote!]!.
It solved the issue.

@JonathanSum
Copy link

I bet everything is not up to date.

@maryjenel
Copy link

I'm getting the same thing as well. Any suggestions?

@levitomer
Copy link

levitomer commented Jan 27, 2020

@GordanRatkovic - I've noticed there are lots of changes in the last revision of graphcool which needs different acts to be done in order for the tutorial to work as expected:

  1. runing graphcool deploy will create an .graphcool.rc which (later) will contain the project cluster id in order to deploy the app in a docker.

  2. In the types.graphql root file, change the schema to the following (note: the File & User type is important since its a system type):

type File @model {
  contentType: String!
  createdAt: DateTime!
  id: ID! @isUnique
  name: String!
  secret: String! @isUnique
  size: Int!
  updatedAt: DateTime!
  url: String! @isUnique
}

type User @model {
  id: ID! @isUnique
  createdAt: DateTime!
  updatedAt: DateTime!
  name: String!
  links: [Link!]! @relation(name: "UsersLinks")
  votes: [Vote!]! @relation(name: "UsersVotes")
}

type Link @model {
  id: ID! @isUnique
  createdAt: DateTime!
  updatedAt: DateTime!
  url: String!
  description: String!
  postedBy: User @relation(name: "UsersLinks")
  votes: [Vote!]! @relation(name: "VotesOnLink")
}

type Vote @model {
  id: ID! @isUnique
  createdAt: DateTime!
  updatedAt: DateTime!
  user: User @relation(name: "UsersVotes")
  link: Link @relation(name: "VotesOnLink")
}
  1. run graphcool login to login (opens your browser for authentication)
  2. run graphcool playground

Hope it help

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

No branches or pull requests

4 participants