Git Product home page Git Product logo

api-design-node-v2's Introduction

Note

This repo is from an archived version of the course. Watch the latest version of the course on frontendmasters.com.

Learn to build with Node, Express, Mongo, and GraphQL.

What you'll need to know

  • JavaScript
  • basic HTTP knowledge
  • basic API knowledge

Dependencies

  • Mongo (if you don't have this, signup for a free mongo DB at mLab)
  • Node 6+
  • Yarn or Npm (Yarn recommended)

Getting Started

The curriculum is broken up by branches. Each branch walks through a different lesson. There are usually some tests you must get to pass. For each branch, there is a solution branch.

  • Checkout to the first lesson branch git checkout lesson-1

Contributing

If you see issues:

  • fork this repo
  • clone your fork
  • cut a branch
  • write your code
  • issue PR to upstream

api-design-node-v2's People

Contributors

1marc 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  avatar  avatar  avatar  avatar

api-design-node-v2's Issues

WIndows issue GraphQLError: Unknown operation named "null".

Ran into a issue while going through the course on FE masters and initially thought it was me. On Windows when running any of the nested query eg.

{ 
  allPlaylists {
    title
    songs {
      title
    }
  }
}

I would get the following error reported server side when I ran the query first time:

GraphQLError: Unknown operation named "null".
    at buildExecutionContext (pathTo\node_modules\graphql\execution\execute.js:202:13)
    at executeImpl (pathTo\node_modules\graphql\execution\execute.js:121:15)
    at Object.execute (pathTo\node_modules\graphql\execution\execute.js:110:229)
    at doRunQuery (pathTo\node_modules\apollo-server-core\src\runQuery.ts:149:16)
    at pathTo\node_modules\apollo-server-core\src\runQuery.ts:70:39
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

On the browser I would get when I run the query before anything else:
image

However if I run a query ie { allPlaylists {title}} first then the nested query it works:
image

Notice that to only difference (apart from the error code) is operationName: "null" compared to operationName: null and as long as you don't refresh graphiql all future queries seem to work its just when you try a nest query before a normal query

To check I was not going mad I quickly checked things on my Mac and had no issues so seems to be a Windows thing so this is a heads up if anyone else runs into the issue (the issue is present on lesson-14-solution branch)

Good course by the way learn t a lot

yarn test Cannot find module 'webpack/lib/Watching'

Error: Cannot find module 'webpack/lib/Watching'
at Function.Module._resolveFilename (module.js:536:15)
at Function.Module._load (module.js:466:25)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
at Object. (/pathToRepo/node_modules/mocha-webpack/lib/webpack/compiler/createWatchCompiler.js:21:17)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)

Windows OS Script Fix

If you are running on windows, you will have to make the following change to the "test:unit" script in your package.json:

"test:unit": "SET NODE_ENV=testing rm -rf ./tmp/mocha-webpack && mocha-webpack --webpack-config webpack.testing.js \"src/**/*.spec.js\" --timeout 10000 --require source-map-support/register",

You'll notice that SET was placed at the beginning of the script.

Is this course going to PluralSight?

I already noticed that a lot of courses from FrontEnd Masters are on PluralSight too. I just watched the version 1 of this course on PluralSight, it's really good and now I see that there is the version 2 already on FrontEnd Masters, though I don't have their membership.

Error when running npm install

image

Above I get:
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(321,
5): error MSB3491: Could not write to file
"Release\obj\bcrypt_lib\bcrypt_lib.tlog\bcrypt_lib.last
buildstate". Process cannot access file 'C:...\api-design-node-v2\node_modules\bcrypt\bui
ld\Release\obj\bcrypt_lib\bcrypt_lib.tlog\bcrypt_lib.lastbuildstate' because it is being used in another process. [C:
...\api-design-node-v2\node_modules\bcrypt\build\bcrypt_lib.vcxproj]

with yarn:
image

Where is verifyUser invoked?

In /src/api/modules/auth.js the signin function has a comment that says "req.user will be there from the middleware verify user." But it's unclear to me where verifyUser is invoked in order to put the user's id on the req object. Any help would be super appreciated.

Cannot start

I'm getting an error when running npm start: "Error: Query.allSongs defined in resolvers, but not in schema".

Hot reloading doesn't work on Windows

I just cloned the repository and switched to lesson-1 branch.

When I setup a basic app.get listener and then starts the server, it works fine. The problem is when I change , for example, the response text, hit save and then initiate a new request, every thing is same as before although I changed the response.

When I click save however, I can see in the logs that webpack patched the changed files correctly.

Haven't touched the module hot reloading configuration. What could be the problem?

not loading .qraphql files with raw-loader

Getting following error when importing .graphql files

export * as userType from './user.graphql'

Error: Cannot find module 'graphql'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)

webpack

{
      test: /\.(graphql|gql)$/,
      exclude: /node_modules/,
      use: {
         loader: 'raw-loader'
        }
}

'raw-loader' version is ^0.5.1

How to solve this?

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.