{"action":"closed","issue":{"url":"https://api.github.com/repos/kriasoft/react-starter-kit/issues/1622","repository_url":"https://api.github.com/repos/kriasoft/react-starter-kit","labels_url":"https://api.github.com/repos/kriasoft/react-starter-kit/issues/1622/labels{/name}","comments_url":"https://api.github.com/repos/kriasoft/react-starter-kit/issues/1622/comments","events_url":"https://api.github.com/repos/kriasoft/react-starter-kit/issues/1622/events","html_url":"https://github.com/kriasoft/react-starter-kit/issues/1622","id":330289015,"node_id":"MDU6SXNzdWUzMzAyODkwMTU=","number":1622,"title":"Graphiql and Implementing New Types and Queries on feature/redux","user":{"login":"ericchen0121","id":606131,"node_id":"MDQ6VXNlcjYwNjEzMQ==","avatar_url":"https://avatars1.githubusercontent.com/u/606131?v=4","gravatar_id":"","url":"https://api.github.com/users/ericchen0121","html_url":"https://github.com/ericchen0121","followers_url":"https://api.github.com/users/ericchen0121/followers","following_url":"https://api.github.com/users/ericchen0121/following{/other_user}","gists_url":"https://api.github.com/users/ericchen0121/gists{/gist_id}","starred_url":"https://api.github.com/users/ericchen0121/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericchen0121/subscriptions","organizations_url":"https://api.github.com/users/ericchen0121/orgs","repos_url":"https://api.github.com/users/ericchen0121/repos","events_url":"https://api.github.com/users/ericchen0121/events{/privacy}","received_events_url":"https://api.github.com/users/ericchen0121/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-07T14:07:38Z","updated_at":"2018-06-09T00:27:47Z","closed_at":"2018-06-09T00:27:47Z","author_association":"NONE","body":"I've been struggling with implementing new data types with Sequelize and Graphiql. \r\n\r\nSetup:\r\nI'm connecting to  a remote postgresql db and the connection is working properly.\r\n\r\nIssues:\r\n~~1) cannot get graphiql to load, even when setting to { ... graphiql: true} in server.js\r\nI've tried localhost:3001/graphiql and localhost:4000/graphiql (which only loads the entire app as on localhost:3000) ~~ \r\n\r\n[RESOLVED] Well, that was easier than I thought. Found viewer on localhost:3000/graphql, which makes sense since the app is listening on this port. I thought that the graphql server was on a different port. Clearly, misunderstood (all docs generally show usage on port 4000)\r\n\r\n2) added a new Graphiql model, query, type. When I import it in /models/index.js, I receive this error:\r\n`Unhandled Rejection at: Promise {\r\n  <rejected> TypeError: Cannot read property 'key' of undefined\r\n    at Sequelize.normalizeDataType`\r\n\r\n3) added dummy data and set the  resolve function\r\n\r\n```\r\nimport BuildType from '../types/BuildType';\r\nimport {  GraphQLInt as IntType } from 'graphql'\r\n\r\nconst builds = [\r\n  {\r\n    id: 15,\r\n    hero_id: 66,\r\n    user_id: 1,\r\n    item_1: 40,\r\n  }\r\n]\r\n\r\nconst build = {\r\n  type: BuildType,\r\n  args: {\r\n    id: {type: IntType}\r\n  },\r\n  resolve(parent, args){\r\n    builds.find(b => b.id === args.id)\r\n    // console.log(db.models.Build.findAll())\r\n    // code to get data from db\r\n  }\r\n};\r\n\r\nexport default build;\r\n```\r\n\r\nI also tried: \r\n```\r\nid: {\r\n  type: DataType.UUID,\r\n  defaultValue: DataType.UUIDV1,\r\n  primaryKey: true,\r\n},\r\n```\r\n\r\nDo I need a sequelize migration file? Why is key undefined? Am I using the right datatype for the key?\r\n\r\nReally lost and stuck. I just want to return some data from my psql database and cannot find any graphiql/sequelize documention for react-starter-kit. \r\n\r\nAny good starting point or reference hopefully will get me unstuck."}}
{"actor":{"display_login":"ericchen0121"}}