Git Product home page Git Product logo

the-road-to-graphql / fullstack-apollo-express-postgresql-boilerplate Goto Github PK

View Code? Open in Web Editor NEW
1.2K 26.0 265.0 3 MB

šŸ’„ A sophisticated GraphQL with Apollo, Express and PostgreSQL boilerplate project.

Home Page: https://roadtoreact.com

License: MIT License

JavaScript 100.00%
react reactjs react-apollo react-apollo-graphql apollographql apollo-client apollo-server apollo-server-express authentication authorization

fullstack-apollo-express-postgresql-boilerplate's Introduction

fullstack-apollo-express-postgresql-boilerplate

Build Status Slack Greenkeeper badge

A full-fledged Apollo Server with Apollo Client starter project with React and Express. Read more about it in this tutorial to build it yourself.

Family of universal fullstack repositories:

Server Applications:

Client Applications:

Features of Client + Server

  • React (create-react-app) with Apollo Client
    • Queries, Mutations, Subscriptions
  • Node.js with Express and Apollo Server
    • cursor-based Pagination
  • PostgreSQL Database with Sequelize
    • entities: users, messages
  • Authentication
    • powered by JWT and local storage
    • Sign Up, Sign In, Sign Out
  • Authorization
    • protected endpoint (e.g. verify valid session)
    • protected resolvers (e.g. e.g. session-based, role-based)
    • protected routes (e.g. session-based, role-based)
  • performance optimizations
    • example of using Facebook's dataloader
  • E2E testing

Installation

  • git clone [email protected]:the-road-to-graphql/fullstack-apollo-express-postgresql-boilerplate.git
  • cd fullstack-apollo-express-postgresql-boilerplate
  • touch .env
  • npm install
  • fill out .env file (see below)
  • start PostgreSQL database
  • npm start
  • visit http://localhost:8000 for GraphQL playground

.env file

Since this boilerplate project is using PostgreSQL, you have to install it for your machine and get a database up and running. You find everything for the set up over here: Setup PostgreSQL with Sequelize in Express Tutorial. After you have created a database and a database user, you can fill out the environment variables in the server/.env file.

DATABASE=mydatabase

DATABASE_USER=postgres
DATABASE_PASSWORD=postgres

SECRET=asdlplplfwfwefwekwself.2342.dawasdq

The SECRET is just a random string for your authentication. Keep all these information secure by adding the .env file to your .gitignore file. No third-party should have access to this information.

Testing

  • adjust test:run-server npm script with TEST_DATABASE environment variable in package.json to match your testing database name
    • to match it from package.json: createdb mytestdatabase with psql
  • one terminal: npm run test:run-server
  • second terminal: npm run test:execute-test

Want to learn more about React + GraphQL + Apollo?

fullstack-apollo-express-postgresql-boilerplate's People

Contributors

greenkeeper[bot] avatar jshuadvd avatar morenoh149 avatar nicolad avatar priestor avatar rpweb avatar rwieruch avatar sonatrix avatar thatneat avatar thomasjfox1 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fullstack-apollo-express-postgresql-boilerplate's Issues

Universal Boilerplate Project Family

I am looking for people who are able to migrate this boilerplate project to different tech stacks. If you want to collaborate on this, please reach out to me on [email protected] Also considering to compensate your open source work that would help this GitHub organization tremendously.

Scenario

For instance, this project is using PostgreSQL with Sequelize. But what about an alternative project using MongoDB with Mongoose? As starting point, I copied this repository over here to give people a chance to migrate it over to MongoDB + Mongoose. You can fork the repository, migrate it, and open a PR for it.

I guess the only files that need to be changed are the ones in the folders resolvers/ and the models/. Maybe also the seeding of the database in src/index.js and the testing setup in package.json.

Guidelines

The twin repositories shouldn't be any different from this original repository except for the exchanged tech stack. If you want to introduce any other improvements, let's discuss and at least do it afterward so that this repository can keep up with the improvements as well.

I want to keep the repositories almost identical to provide an extended GraphQL server tutorial in the end. So far, the tutorial only covers PostgreSQL with Sequelize for a GraphQL server. But once a MongoDB + Mongoose boilerplate project would be ready, I would add additional chapter to the tutorial.

Action required: Greenkeeper could not be activated šŸšØ

šŸšØ You need to enable Continuous Integration on all branches of this repository. šŸšØ

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didnā€™t receive a CI status on the greenkeeper/initial branch, itā€™s possible that you donā€™t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how itā€™s configured. Make sure it is set to run on all new branches. If you donā€™t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, youā€™ll need to re-trigger Greenkeeperā€™s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper Appā€™s white list on Github. You'll find this list on your repo or organizationā€™s settings page, under Installed GitHub Apps.

bcrypt vs bcrypt.js

If you run into any problems with bcrypt on Windows while installing it, you can try out a substitute called bcrypt.js. It is slower, but people reported that it works on their machine.

Errors: models.Message.findById is not a function

Just want to start off by thanking you @rwieruch for your amazing tutorial. It's definitely the most comprehensive tutorial I've ever read on the subject.

I'm running into a problem with my server after finishing up the Authorization section of the Tutorial. I'm unable to run the query in the following section GraphQL Custom Scalars in Apollo Server and get the following error below.

I've tried to revisit the codebase here and copy it back page by page to see which (if any) would've caused the problem, but after cloning the whole repository again, I'm still getting the same issue. Any help helping me understand what's going on would be greatly appreciated.

This is the query in question:

query {
  message(id: "1") {
    id
    createdAt
    user {
      username
    }
  }
}

This is the error I'm getting and where:

{
  "errors": [
    {
      "message": "models.Message.findById is not a function",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "comment"
      ],
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR",
        "exception": {
          "stacktrace": [
            "TypeError: models.Message.findById is not a function",
            "    at findById (/Users/user/Documents/Self/BFF/src/resolvers/message.js:11:35)",

Action required: Greenkeeper could not be activated šŸšØ

šŸšØ You need to enable Continuous Integration on all branches of this repository. šŸšØ

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didnā€™t receive a CI status on the greenkeeper/initial branch, itā€™s possible that you donā€™t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how itā€™s configured. Make sure it is set to run on all new branches. If you donā€™t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, youā€™ll need to re-trigger Greenkeeperā€™s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper Appā€™s white list on Github. You'll find this list on your repo or organizationā€™s settings page, under Installed GitHub Apps.

An in-range update of pg is breaking the build šŸšØ

The dependency pg was updated from 7.10.0 to 7.11.0.

šŸšØ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

pg is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • āŒ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 3 commits.

  • 61cc3d2 Bump version
  • 697bdae Update changelog
  • 0993e4b Added the missing connect_timeout and keepalives_idle config parameters (#1847)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those donā€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot šŸŒ“

An in-range update of apollo-server is breaking the build šŸšØ

There have been updates to the apollo-server monorepo:

šŸšØ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the apollo-server group definition.

apollo-server is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • āŒ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those donā€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot šŸŒ“

session not updating after you log in !

hi,

i just noticed, when you log in successfully , the session is going undefined and because of it the navigation options are not getting updated after history push , but when you reload the page it will update the ui and you can see the session variables filled with the data too.

.

Server returns deprecated format of 'createdAt' timestamps

Playground somehow displays another representation of the timestamps then expected.

With this query:
query { message(id: "1") { text createdAt } }

I get this as result:
{ "data": { "message": { "text": "Published the Road to learn React", "createdAt": "1539693730039" } } }

An in-range update of babel7 is breaking the build šŸšØ

There have been updates to the babel7 monorepo:

    • The devDependency @babel/core was updated from 7.4.3 to 7.4.4.

šŸšØ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the babel7 group definition.

babel7 is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • āŒ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those donā€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot šŸŒ“

Remove babel

modern node runtimes have full support for async await. node 10x LTS has this. This project uses node 10 already.

Remove babel dependency.

DataLoader issue with $in

When I use the following from the example

  const users = await models.User.findAll({
    where: {
      id: {
        $in: keys,
      },
    },
  });

I get the following error

{
  "errors": [
    {
      "message": "Invalid value { '$in': [ 1, 2, 3 ] }",
      "locations": [
        {
          "line": 4,
          "column": 5
        }
      ],
      "path": [
        "accounts",
        0,
        "user"
      ],
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR",
        "exception": {
          "stacktrace": [
            "Error: Invalid value { '$in': [ 1, 2, 3 ] }",
            "    at Object.escape (/Users/***/Documents/code/*** /***-server/node_modules/sequelize/lib/sql-string.js:66:11)",
            "    at Object.escape (/Users/***/Documents/code/*** /***-server/node_modules/sequelize/lib/dialects/abstract/query-generator.js:936:22)",
            "    at Object._whereParseSingleValueObject (/Users/***/Documents/code/*** /***-server/node_modules/sequelize/lib/dialects/abstract/query-generator.js:2432:41)",
            "    at Object.whereItemQuery (/Users/***/Documents/code/*** /***-server/node_modules/sequelize/lib/dialects/abstract/query-generator.js:2136:21)",
            "    at Utils.getComplexKeys.forEach.prop (/Users/***/Documents/code/*** /***-server/node_modules/sequelize/lib/dialects/abstract/query-generator.js:1997:25)",
            "    at Array.forEach (<anonymous>)",
            "    at Object.whereItemsQuery (/Users/***/Documents/code/*** /***-server/node_modules/sequelize/lib/dialects/abstract/query-generator.js:1995:35)",
            "    at Object.getWhereConditions (/Users/***/Documents/code/*** /***-server/node_modules/sequelize/lib/dialects/abstract/query-generator.js:2459:19)",
            "    at Object.selectQuery (/Users/***/Documents/code/*** /***-server/node_modules/sequelize/lib/dialects/abstract/query-generator.js:1143:28)",
            "    at QueryInterface.select (/Users/***/Documents/code/*** /***-server/node_modules/sequelize/lib/query-interface.js:1105:27)",
            "    at Promise.try.then.then.then (/Users/***/Documents/code/*** /***-server/node_modules/sequelize/lib/model.js:1598:34)",
            "    at tryCatcher (/Users/***/Documents/code/*** /***-server/node_modules/bluebird/js/release/util.js:16:23)",
            "    at Promise._settlePromiseFromHandler (/Users/***/Documents/code/*** /***-server/node_modules/bluebird/js/release/promise.js:512:31)",
            "    at Promise._settlePromise (/Users/***/Documents/code/*** /***-server/node_modules/bluebird/js/release/promise.js:569:18)",
            "    at Promise._settlePromise0 (/Users/***/Documents/code/*** /***-server/node_modules/bluebird/js/release/promise.js:614:10)",
            "    at Promise._settlePromises (/Users/***/Documents/code/*** /***-server/node_modules/bluebird/js/release/promise.js:694:18)",
            "    at _drainQueueStep (/Users/***/Documents/code/*** /***-server/node_modules/bluebird/js/release/async.js:138:12)",
            "    at _drainQueue (/Users/***/Documents/code/*** /***-server/node_modules/bluebird/js/release/async.js:131:9)",
            "    at Async._drainQueues (/Users/***/Documents/code/*** /***-server/node_modules/bluebird/js/release/async.js:147:5)",
            "    at Immediate.Async.drainQueues [as _onImmediate] (/Users/***/Documents/code/*** /***-server/node_modules/bluebird/js/release/async.js:17:14)",
            "    at processImmediate (timers.js:632:19)"
          ]
        }
      }
    }
  ],
  "data": {
    "accounts": null
  }
}

if I change it to the following then everything works

  const users = await models.User.findAll({
    where: {
      id: keys,
    },
  });

I don't know if this is because I have a newer package or something. But it took me hours to figure it out, so I figured I would share with everyone else

npm run scripts on Windows

npm run scripting syntax is slightly different on Windows due to the underlying shell being used. Usually the default is cmd.exe (the old DOS), even though it is possible to override the default.

The key changes required for the testing scripts (p. 315 of the book) are:
"test-server": "set TEST_DATABASE=mytestdatabase&& npm start", "test": "mocha --require @babel/register src/**/*.spec.js"
In test-server, there is no space between the variable's value and && on purpose otherwise trailing spaces would be added to the value (https://stackoverflow.com/questions/25112510/how-to-set-environment-variables-from-within-package-json-node-js#comment58812038_27090755).
Note that TEST_DATABASE=mytestdatabase && npm start will not work in Linux because && starts another shell where the variable is not defined.

In test, single quote are omitted otherwise * are not expanded, or at leasr I think.

Unfortunately there is no way to define cross environment scripts without using external packages.

Cannot deploy to Heroku: Bcrypt 3.X.X

If anyone runs into this problem as I did today with Bcrypt while deploying to Heroku, this may help you.

Locally I am using Node version 10.11.0, but because I haven't specified anything else in the package.json file, Heroku took a default Node version 8.XX.XX for its own build. When using Bcrypt 3.0.2 and Node 8.XX.XX it didn't work. Then I set it explicitly the Node version for Heroku in the package.json file. It worked:

{
  "name": "my-app",
  "version": "1.0.0",
  "description": "",
  "engines": {
    "node": "10.11.0"
  },
  ...
}

Issue with jwt claims

This is less of an issue with the boilerplate and the project itself and more of a 'add-on' issue where I'm trying to add several different claims such as jti, iss and nbf. I've been able to add the jwtid and iss without issues, but attempting to put an nbf claim make it so that the playground not able to reach the server.

Wondering if you've had any issues with this before?

edit: seems I just put in the wrong format

How to add refresh tokens to this?

Hi, sorry for the newbie question but how do I incorporate refresh tokens with this?

When following the boilerplate, any signed-in users will need to login again every 30 minutes due to the token expiring. From what I've read (I'm very new to backend stuff), the best way to handle this is by using refresh tokens. I've tried following a few guides online but they use a different stack so it's hard to figure out how to incorporate it into this boilerplate.

Any tips?

An in-range update of nodemon is breaking the build šŸšØ

The devDependency nodemon was updated from 1.18.5 to 1.18.6.

šŸšØ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

nodemon is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • āŒ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v1.18.6

1.18.6 (2018-11-05)

Bug Fixes

Commits

The new version differs by 1 commits.

  • 521eb1e fix: restart on change for non-default signals (#1409) (#1430)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those donā€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot šŸŒ“

environment variables undefined

When I try to start the site (~p. 248), I'm met with the following error:

Unhandled rejection SequelizeConnectionError: password authentication failed for user "crash"

which caught me off guard because my .env file is:

DATABASE=gql
DATABASE_USER=postgres
DATABASE_PASSWORD=postgres

After going down the rabbit hole with Postgres and permissions and still not solving the issue I tried logging my environment variables only to find them undefined. (Really, that should have been the first place I checked).

I was able to fix the issue by updating /models/index.js and adding:

import 'dotenv/config';

I see it also exists in /src/index.js in the repo, but the book never specifies adding it anywhere. Updating the code for the index on p. 243 would save the reader a lot of troubleshooting.

An in-range update of nodemon is breaking the build šŸšØ

The devDependency nodemon was updated from 1.18.11 to 1.19.0.

šŸšØ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

nodemon is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • āŒ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v1.19.0

1.19.0 (2019-05-01)

Bug Fixes

  • disable fork only if string starts with dash (886527f), closes #1554
  • Quote zero-length strings in arguments (#1551) (2973afb)

Features

Commits

The new version differs by 4 commits.

  • 20ccb62 feat: add message event
  • 886527f fix: disable fork only if string starts with dash
  • 64b474e feat: add TypeScript to default execPath (#1552)
  • 2973afb fix: Quote zero-length strings in arguments (#1551)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those donā€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot šŸŒ“

An in-range update of graphql is breaking the build šŸšØ

The dependency graphql was updated from 14.2.1 to 14.3.0.

šŸšØ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

graphql is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • āŒ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 37 commits.

  • 4bd1a11 v14.3.0
  • 972a150 Update Flow to 0.98.1 (#1852)
  • e90a5ca nyc: Switch config from JSON to YAML and move args from package.json (#1851)
  • d69c533 Add comment to make test better understandable (#1850)
  • 9ab5dfb Update deps (#1849)
  • e0fbf90 Remove Flow workaround for const arguments (#1848)
  • ccbbb29 isSpecifiedDirective should not assume Directive type (#1837)
  • d6c973a Adapt benchmark to the new build script (#1845)
  • 316e24e Correctly trap errors in shell scripts (#1844)
  • 22f0719 Fix "npm run build" on Node 10 (#1843)
  • ec206fc Terminate shell scripts if any subcomand terminated (#1842)
  • c11ccba Make single 'build.js' to handle NPM package build (#1841)
  • 1023264 ESLint: enable 'arrow-body-style' rule (#1840)
  • cd80f94 ESLint: enable all low-hanging rules and mark rest as TODO (#1839)
  • ce832ee Mark all ESLint rules that conflict with Prettier (#1838)

There are 37 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those donā€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot šŸŒ“

An in-range update of apollo-server is breaking the build šŸšØ

The dependency apollo-server was updated from 2.1.0 to 2.2.0.

šŸšØ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

apollo-server is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • āŒ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those donā€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot šŸŒ“

Action required: Greenkeeper could not be activated šŸšØ

šŸšØ You need to enable Continuous Integration on all branches of this repository. šŸšØ

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didnā€™t receive a CI status on the greenkeeper/initial branch, itā€™s possible that you donā€™t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how itā€™s configured. Make sure it is set to run on all new branches. If you donā€™t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, youā€™ll need to re-trigger Greenkeeperā€™s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper Appā€™s white list on Github. You'll find this list on your repo or organizationā€™s settings page, under Installed GitHub Apps.

Use new Apollo concepts and syntax (e.g. DataSources)

This project and tutorial looks great, however it may already be outdated as there is now DataSources (https://www.apollographql.com/docs/apollo-server/features/data-sources.html) in Apollo which fosters better separation of application and DB. This should be the way forward.

A problem is that there isn't much documentation or examples for using DataSources with a DB (only REST source). Here is a simple example developed by one of the Apollo developers: https://github.com/apollographql/fullstack-workshop-server/blob/datasources/src/datasources/LikesDB.js

Here is another simple example app that uses DataSources, React-Apollo components and Meteor:
https://github.com/tab00/test-meteor-apollo

Note that neither of these implement batching and caching (which a production-ready app should do).

Could you please update your code and tutorial so that it uses the latest Apollo concepts and syntax?

An in-range update of apollo-server-express is breaking the build šŸšØ

The dependency apollo-server-express was updated from 2.1.0 to 2.2.0.

šŸšØ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

apollo-server-express is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • āŒ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those donā€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot šŸŒ“

client can't reach graphql server

hi,
after following the instructions in the readme I'm getting this:
screen shot 2018-09-16 at 15 20 25
The graphQL server is running and I can execute the queries as well, but somehow the client can not reach it. I tried it on 2 PCs already.
Any ideas?
thx in advance!

An in-range update of apollo-server is breaking the build šŸšØ

There have been updates to the apollo-server monorepo:

šŸšØ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the apollo-server group definition.

apollo-server is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • āŒ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those donā€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot šŸŒ“

signOut client undefined

In client/src/index.js client is undefined? I work on a similar project but I can't get my head around this.

if (networkError) {
    console.log('Network error', networkError);
    if (networkError.statusCode === 401) {
      signOut(client);
    }
  }

we reference client further below in

const client = new ApolloClient({
  link,
  cache,
});

An in-range update of apollo-server is breaking the build šŸšØ

There have been updates to the apollo-server monorepo:

šŸšØ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the apollo-server group definition.

apollo-server is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • āŒ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those donā€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot šŸŒ“

Base64 encoding of date fails

The following functions caused me problems:

const toCursorHash = string => Buffer.from(string).toString('base64');
const fromCursorHash = string => (Buffer.from(string, 'base64').toString('utf-8');

Apparently the createdAt object passed to toCursorHash() was not of type string. I got the following error message:

TypeError [ERR_INVALID_ARG_TYPE]: The "value" argument must not be of type number. Received type number

Tested what type of the string is with javascripts typeof, and it revealed it to be of type object.

I fixed it with

const toCursorHash = string => Buffer.from(JSON.stringify(string)).toString('base64');
const fromCursorHash = string => JSON.parse(Buffer.from(string, 'base64').toString('utf-8'));

However, I'm curious of why this happened and why it appears to work for others as in the book.

Setup:

  • Windows 10 with WSL Ubuntu 18.04.1 LTS
  • Node v10.14.1

Server: NPM Scripts for Testing

At the moment, there are two scripts in order to test the server. One to start the test server and the second one to execute the tests. Is there a way to put this into one command for being able to test in only one command line tab? I am looking for something like this but it didn't work for me.

Action required: Greenkeeper could not be activated šŸšØ

šŸšØ You need to enable Continuous Integration on all branches of this repository. šŸšØ

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didnā€™t receive a CI status on the greenkeeper/initial branch, itā€™s possible that you donā€™t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how itā€™s configured. Make sure it is set to run on all new branches. If you donā€™t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, youā€™ll need to re-trigger Greenkeeperā€™s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper Appā€™s white list on Github. You'll find this list on your repo or organizationā€™s settings page, under Installed GitHub Apps.

Action required: Greenkeeper could not be activated šŸšØ

šŸšØ You need to enable Continuous Integration on all branches of this repository. šŸšØ

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didnā€™t receive a CI status on the greenkeeper/initial branch, itā€™s possible that you donā€™t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how itā€™s configured. Make sure it is set to run on all new branches. If you donā€™t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, youā€™ll need to re-trigger Greenkeeperā€™s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper Appā€™s white list on Github. You'll find this list on your repo or organizationā€™s settings page, under Installed GitHub Apps.

Server: Dotenv

At the moment, the dotenv setup happens in a separate file: src/env.js. This file is imported in the src/index.js file for initializing all the environment variables from the .env file. Is there a way to have the initialization in the src/index.js file so that the src/models/index.js file has access to the process.env variables? In my case, these variables turned out to be undefined all the time.

An in-range update of apollo-server is breaking the build šŸšØ

There have been updates to the apollo-server monorepo:

šŸšØ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the apollo-server group definition.

apollo-server is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • āŒ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those donā€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot šŸŒ“

An in-range update of apollo-server is breaking the build šŸšØ

There have been updates to the apollo-server monorepo:

šŸšØ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the apollo-server group definition.

apollo-server is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • āŒ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those donā€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot šŸŒ“

Resolvers in src/resolvers/authorization.js do not return

In my testing of the master branch I found that resolvers isAuthenticated and isAdmin in src/resolvers/authorization.js do not return, and so do not prevent the action their existance was intended to prevent. Perhaps I should create a pull request instead of an "issue"? I am new so please forgive me.

Enable SSR

It would be great to include server side rendering.

Folder Structure

First, nice project. I love it!
I would like to ask you, what you recommend as folders structure for a bigger project? Your Components folder already has a lot of components. I'm new to React and would be great to know your opinion about it...
Maybe we can come up with some ideas and I would happily send a PR with the new layout. A new branch, maybe?

An in-range update of apollo-server is breaking the build šŸšØ

There have been updates to the apollo-server monorepo:

šŸšØ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the apollo-server group definition.

apollo-server is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • āŒ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those donā€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot šŸŒ“

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.