Giter VIP home page Giter VIP logo

graphql-with-sequelize's Introduction

Lee Benson's GitHub stats

graphql-with-sequelize's People

Contributors

julianmnst avatar katt avatar leebenson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

graphql-with-sequelize's Issues

Avoid fetching all entries in peopleRelay

Hey!

I've just started playing around with this. It's a great introduction!

Here we're fetching all person entries and let the graphql-relay lib do the pagination. How would you go about this if you want to make sure you could do pagination without fetching all the entries?

Split into folders

Hi there @leebenson ! I have a simple question. How would one split the schema into maybe separate folders or at least files to make it easier to mantain? Thanks in advance!

Referencing object in Javascript string

Lee,

This is probably a newbie goof, but I had to replace your inline object reference to create a post with the person's firstName (in db.js)...

// title: 'Sample title by ${person.firstName}',
title: 'Sample title by ' + person.firstName,

I am using node 6 rather than node 5 - Do you know if I have to add another dependency to get this object reference functionality?

Thanks

Cannot read property 'person' of undefined

Getting below error with MySQL connection:

{
    "errors": [
    {
        "message": "Cannot read property 'person' of undefined",
        "locations": [
            {
                "line": 29,
                "column": 3
            }
        ],
        "path": [
            "people"
        ]
    }
],
    "data": {
    "people": null
}
}

TypeError: Cannot call a class as a function

hello I found this error when I run
./node_modules/.bin/babel-node server.js
here all the trace of information:

/Users/lrodriguez/graphql-sequelize-test/graphql-with-sequelize/node_modules/graphql/node_modules/babel-runtime/helpers/class-call-check.js:5 throw new TypeError("Cannot call a class as a function"); TypeError: Cannot call a class as a function at exports.default (/Users/lrodriguez/graphql-sequelize-test/graphql-with-sequelize/node_modules/graphql/node_modules/babel-runtime/helpers/class-call-check.js:5:11) at GraphQLNonNull (/Users/lrodriguez/graphql-sequelize-test/graphql-with-sequelize/node_modules/graphql/type/definition.js:759:5) at fields (/Users/lrodriguez/graphql-sequelize-test/graphql-with-sequelize/schema.js:137:19) at resolveMaybeThunk (/Users/lrodriguez/graphql-sequelize-test/graphql-with-sequelize/node_modules/graphql/type/definition.js:265:47) at defineFieldMap (/Users/lrodriguez/graphql-sequelize-test/graphql-with-sequelize/node_modules/graphql/type/definition.js:284:18) at GraphQLObjectType.getFields (/Users/lrodriguez/graphql-sequelize-test/graphql-with-sequelize/node_modules/graphql/type/definition.js:245:46) at /Users/lrodriguez/graphql-sequelize-test/graphql-with-sequelize/node_modules/graphql/type/schema.js:174:29 at typeMapReducer (/Users/lrodriguez/graphql-sequelize-test/graphql-with-sequelize/node_modules/graphql/type/schema.js:186:9) at Array.reduce (native) at new GraphQLSchema (/Users/lrodriguez/graphql-sequelize-test/graphql-with-sequelize/node_modules/graphql/type/schema.js:81:120) at Object.<anonymous> (/Users/lrodriguez/graphql-sequelize-test/graphql-with-sequelize/schema.js:159:16) at Module._compile (module.js:570:32) at loader (/Users/lrodriguez/graphql-sequelize-test/graphql-with-sequelize/node_modules/babel-register/lib/node.js:144:5) at Object.require.extensions.(anonymous function) [as .js] (/Users/lrodriguez/graphql-sequelize-test/graphql-with-sequelize/node_modules/babel-register/lib/node.js:154:7) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12)

Need help with referencing types when they have yet to be defined in code order

Hello, I'm having trouble getting this code to work

const articleType = new GraphQLObjectType({
  name: 'Article',
  fields: {
    id: {
      type: GraphQLInt
    },
    name: {
      type: GraphQLString
    },
    description: {
      type: GraphQLString
    },
    createdBy: {
      type: userType,
      resolve(article) {
        return article.findUser();
      }
    }
  }
});

const userType = new GraphQLObjectType({
  name: 'User',
  fields: {
    id: {
      type: GraphQLInt
    },
    name: {
      type: GraphQLString
    },
    lastName: {
      type: GraphQLString

    },
    email: {
      type: GraphQLString
    },
    createdAt: {
      type: GraphQLString
    },
    articles: {
      type: new GraphQLList(articleType),
      resolve(user) {
        return user.getArticles();
      }
    }
  }
});

in articleType I'm trying to use userType but when I run the server it errrors out with Article.createdBy field type must be Output Type but got: undefined.

How can I fix this :l

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.