You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just follow the tutorial demo but meet this error.
# error
ts-node -r tsconfig-paths/register src/service.ts
# solve the error above but can't resolve alias path
ts-node -r src/service.ts
TypeError: graphql_1.parse is not a function
at Object.<anonymous> (D:\Project\web\blog-service\node_modules\graphql-tools\src\stitching\introspectSchema.ts:7:48)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Object.require.extensions.(anonymous function) [as .js] (D:\Code\nodejs\node_global\node_modules\ts-node\src\index.ts:485:14)
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:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (D:\Project\web\blog-service\node_modules\graphql-tools\src\stitching\index.ts:2:1)
import{ApolloServer,gql}from"apollo-server-koa";consttypeDefs=gql` # Comments in GraphQL strings (such as this one) start with the hash (#) symbol. # This "Book" type defines the queryable fields for every book in our data source. type Book { title: String author: String } # The "Query" type is special: it lists all of the available queries that # clients can execute, along with the return type for each. In this # case, the "books" query returns an array of zero or more Books (defined above). type Query { books: [Book] }`;constbooks=[{title: "Harry Potter and the Chamber of Secrets",author: "J.K. Rowling"},{title: "Jurassic Park",author: "Michael Crichton"}];// Resolvers define the technique for fetching the types defined in the// schema. This resolver retrieves books from the "books" array above.constresolvers={Query: {books: ()=>books}};// The ApolloServer constructor requires two parameters: your schema// definition and your set of resolvers.exportdefaultnewApolloServer({ typeDefs, resolvers });
The text was updated successfully, but these errors were encountered:
This seems to be an ApolloServer error rather than a graphql-tools error. Closing for now, please reopen if you have more info. Possibly fixed by work along the lines of #1320 ?
Error Report
Just follow the tutorial demo but meet this error.
Source Code
src/graphql/index.ts
The text was updated successfully, but these errors were encountered: