Giter Site home page Giter Site logo

frontendmasters / advanced-graphql Goto Github PK

View Code? Open in Web Editor NEW
111.0 111.0 99.0 725 KB

[Course] Advanced GraphQL - Learn advanced practices and techniques when when building a GraphQL API.

Home Page: https://frontendmasters.com/courses/advanced-graphql/

JavaScript 100.00%

advanced-graphql's People

Contributors

1marc avatar arausly avatar blackxored avatar cristian-gabbanini avatar dtauer avatar hendrixer 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

advanced-graphql's Issues

Cannot return null for non-nullable field

I have this error when i try to launch lesson-1-solution

{ "data": { "helloWorld": null }, "errors": [ { "message": "Cannot return null for non-nullable field HelloWorld.message.", "locations": [ { "line": 3, "column": 5 } ], "path": [ "helloWorld", "message" ] } ] }

Can you help?

Unable to start

Hi! Not sure if anyone experiencing the same but when I try to start lesson-1 I get following error thrown:

advanced-graphql ๐ŸŒฟ $ yarn dev
yarn run v1.7.0
$ nodemon src/server
[nodemon] 1.17.5
[nodemon] reading config ./nodemon.json
[nodemon] to restart at any time, enter `rs`
[nodemon] or send SIGHUP to 5007 to restart
[nodemon] watching: src/**/* index.js config.js
[nodemon] watching extensions: js,json,graphql
[nodemon] forking
[nodemon] child pid: 5009
[nodemon] watching 11 files

/.../fem/advanced-graphql/node_modules/graphql/language/parser.js:152
  throw unexpected(lexer);
  ^
GraphQLError: Syntax Error: Unexpected <EOF>
....
[nodemon] app crashed - waiting for file changes before starting...

Any clues?

Cannot start app: `Error: Token authentication requires a token to be set`

Please see below issue. I had this problem initially, then deleted the repo and started again, no improvement. Steps documenting install and subsequent error message is below.
Thank you.

user@K1HV2F  ~/References $ git clone https://github.com/FrontendMasters/advanced-graphql.git
Cloning into 'advanced-graphql'...
remote: Enumerating objects: 211, done.
remote: Total 211 (delta 0), reused 0 (delta 0), pack-reused 211
Receiving objects: 100% (211/211), 68.72 KiB | 1.06 MiB/s, done.
Resolving deltas: 100% (112/112), done.
user@K1HV2F ~/References $ ls
Advanced-React		advanced-graphql
user@K1HV2F ~/References $ cd advanced-graphql/
user@K1HV2F ~/References/advanced-graphql(master) $ ls
README.md	package.json	tests
nodemon.json	src		yarn.lock
user@K1HV2F ~/References/advanced-graphql(master) $ yarn install
yarn install v1.9.4
[1/4] ๐Ÿ”  Resolving packages...
[2/4] ๐Ÿšš  Fetching packages...
error [email protected]: The engine "node" is incompatible with this module. Expected version ">=4 <=9".
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
user@K1HV2F ~/References/advanced-graphql(master) $ yarn dev
yarn run v1.9.4
$ nodemon src/server
/bin/sh: nodemon: command not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
user@K1HV2F ~/References/advanced-graphql(master) $ npm install
npm WARN deprecated [email protected]: Please migrate to https://npm.im/graphql-upload (see https://git.io/fADhl).
npm WARN deprecated [email protected]: use String.prototype.padStart()

> [email protected] install /Users/user/References/advanced-graphql/node_modules/fsevents
> node install

node-pre-gyp WARN Using request for node-pre-gyp https download
[fsevents] Success: "/Users/user/References/advanced-graphql/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" is installed via remote

> [email protected] postinstall /Users/user/References/advanced-graphql/node_modules/core-js
> node scripts/postinstall || echo "ignore"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> [email protected] postinstall /Users/user/References/advanced-graphql/node_modules/nodemon
> node bin/postinstall || exit 0

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] requires a peer of graphql@^14.1.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] No repository field.

added 895 packages from 589 contributors and audited 19509 packages in 15.661s
found 63 low severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
user@K1HV2F ~/References/advanced-graphql(master) $ npm run dev

> [email protected] dev /Users/user/References/advanced-graphql
> nodemon src/server

[nodemon] 1.19.1
[nodemon] reading config ./nodemon.json
[nodemon] to restart at any time, enter `rs`
[nodemon] or send SIGHUP to 22355 to restart
[nodemon] watching: src/**/* index.js config.js
[nodemon] watching extensions: js,json,graphql
[nodemon] forking
[nodemon] child pid: 22357
[nodemon] watching 18 files
[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4
/Users/user/References/advanced-graphql/node_modules/@octokit/rest/lib/plugins/authentication/authenticate.js:26
        throw new Error('Token authentication requires a token to be set')
        ^

Error: Token authentication requires a token to be set
    at authenticate (/Users/user/References/advanced-graphql/node_modules/@octokit/rest/lib/plugins/authentication/authenticate.js:26:15)
    at Object.<anonymous> (/Users/user/References/advanced-graphql/src/api/github.js:4:11)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:690:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/Users/user/References/advanced-graphql/src/api/loaders.js:4:25)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:690:17)
[nodemon] app crashed - waiting for file changes before starting...

Passing arguments to data loader

Hi I'm struggling to wrap my heads around how to pass an arguments to data loader to resolve resouces, any example code would be helpful. Thanks.

Error when starting the application

I'm able to install all dependencies. After I run the application, the GraphQL playground starts but it's accompanied with an error in the log.
UnhandledPromiseRejectionWarning: MongoNetworkError: failed to connect to server [localhost:27017] on first connect [MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017] at Pool.<anonymous> (C:\Users\ernestina.wadee\Documents\GitHub\advanced-graphql\node_modules\mongodb-core\lib\topologies\server.js:505:11) at emitOne (events.js:116:13) at Pool.emit (events.js:211:7) at Connection.<anonymous> (C:\Users\ernestina.wadee\Documents\GitHub\advanced-graphql\node_modules\mongodb-core\lib\connection\pool.js:329:12) at Object.onceWrapper (events.js:317:30) at emitTwo (events.js:126:13) at Connection.emit (events.js:214:7) at Socket.<anonymous> (C:\Users\ernestina.wadee\Documents\GitHub\advanced-graphql\node_modules\mongodb-core\lib\connection\connection.js:245:50) at Object.onceWrapper (events.js:315:30) at emitOne (events.js:116:13) at Socket.emit (events.js:211:7) at emitErrorNT (internal/streams/destroy.js:64:8) at _combinedTickCallback (internal/process/next_tick.js:138:11) at process._tickCallback (internal/process/next_tick.js:180:9) (node:12940) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:12940) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Failed to start Playground

image

Duplicate "graphql" modules cannot be used at the same time since different
versions may have different capabilities and behavior. The data from one
version used in the function from another could produce confusing and
spurious results.
    at instanceOf (/Users/faimohammed/Documents/faizrepo/advanced-graphql/node_modules/graphql/jsutils/instanceOf.js:15:13)
    at isSchema (/Users/faimohammed/Documents/faizrepo/advanced-graphql/node_modules/graphql/type/schema.js:52:35)
    at validateSchema (/Users/faimohammed/Documents/faizrepo/advanced-graphql/node_modules/graphql/type/validate.js:55:25)
    at assertValidSchema (/Users/faimohammed/Documents/faizrepo/advanced-graphql/node_modules/graphql/type/validate.js:80:16)
    at Object.validate (/Users/faimohammed/Documents/faizrepo/advanced-graphql/node_modules/graphql/validation/validate.js:58:35)
    at doRunQuery (/Users/faimohammed/Documents/faizrepo/advanced-graphql/node_modules/apollo-server-core/dist/runQuery.js:111:42)
    at /Users/faimohammed/Documents/faizrepo/advanced-graphql/node_modules/apollo-server-core/dist/runQuery.js:21:56
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
Error: Cannot use GraphQLSchema "[object GraphQLSchema]" from another module or realm.

Ensure that there is only one instance of "graphql" in the node_modules
directory. If different versions of "graphql" are the dependencies of other
relied on modules, use "resolutions" to ensure only one version is installed.

https://yarnpkg.com/en/docs/selective-version-resolutions

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.