frontendmasters / api-design-node-v2 Goto Github PK
View Code? Open in Web Editor NEW[Course] API Design in Node.js, v2: REST & GraphQL code
Home Page: https://frontendmasters.com/courses/api-node-rest-graphql/
[Course] API Design in Node.js, v2: REST & GraphQL code
Home Page: https://frontendmasters.com/courses/api-node-rest-graphql/
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.
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?
I'm getting an error when running npm start: "Error: Query.allSongs defined in resolvers, but not in schema".
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)
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:
However if I run a query ie { allPlaylists {title}}
first then the nested query it works:
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
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]
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?
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.