This course has been updated! We now recommend you take the Server-Side GraphQL in Node.js course.

Check out a free preview of the full Introduction to GraphQL course:
The "GraphQL Q&A" Lesson is part of the full, Introduction to GraphQL course featured in this preview video. Here's what you'd learn in this lesson:

Questions are asked about the VSCode GraphQL extension, a clarification about the schemas and resolvers, and Apollo server's relation to Express.

Get Unlimited Access Now

Transcript from the "GraphQL Q&A" Lesson

[00:00:00]
>> Speaker 2: As far as VS code extensions, do you use the GraphQL extension?
>> Scott Moss: No, I don't use a GraphQL extension. I think that GraphQL extension is really cool, the ones that they have. I just don't use it because lately, the type of GraphQL servers I've been making couldn't take advantage of the extensions.

[00:00:19] As in what the extensions do, at least the ones that I've seen, they basically look at your GraphQL schema and they allow you to get all to get all to complete in your schemas. If you have schemas spread across different files, they might interact with type script and give you some typing stuff there.

[00:00:34] I haven't had a product that was traditionally set up to do that. Most of the GraphQL stuff that I've been working on has been dynamic Graph QL schemas on the fly so it's just like AST lower level stuff, so I couldn't take advantage of them. The only GraphQL plug in that I say that I'm using is just one for syntax highlighting.

[00:00:50] So if you were to open up a GraphQL file, it'll look pretty. But yeah, I will say the really good GraphQL extensions for VS code are the ones we're going to use on our front end app. Whereas you can give it your service GraphQL file and it will give you all the complete insight of your React app or your Vue app, or your Angular app.

[00:01:10] Those are the best.
>> Speaker 2: So would it be safe to say that a schema defines the structure of valid queries for the client side? And resolvers are the functions which names match the schema that actually do the work of querying the database?
>> Scott Moss: That's exactly right, whoever that is should just come teach the course.

[00:01:32]
>> Speaker 2: Is Apollo server an alternative to Express or is it an extension, are both needed?
>> Scott Moss: So if you go look at Apollo Server, if you look at the source code it actually does use Express, underneath it. This is like their second version of Apollo Server, this is like Apollo Server two.

[00:01:49] Before this, you had to download the accompanying Apollo Server for your server framework, so you had to either get Apollo Server Express or Apollo Server Happy, whatever your favorite was. Now they just simplified it. We're just going to make our own server and encapsulate Express. But they also still support if you have Express.

[00:02:08] For instance if you have a REST API or something else that you're doing and you want to add GraphQL to it, you can still dial it Apollo Server Express and you can basically add your GraphQL server, your Apollo Server as little ware to your server that you already have.

[00:02:23] So they do work hand in hand, because at the end of the day, Apollo Server is just Express.