Open TAnas0 opened 4 years ago
Does this mean ncc does not recognize graphql
files? We're having some trouble with our build and assumed ncc could load graphql files until I saw this issue.
As much I hate "me too" issues, here's my code having the same problem. It's using graphql-import-node module and graphql.print to serialize to string.
// src/CommentApi/Queries/index.ts
import "graphql-import-node";
import { print } from "graphql"
import getArticleStatsDocument from "./getArticleStats.graphql";
export const getArticleStats: string = (() => {
return print(getArticleStatsDocument);
})();
had similar error with jest, but that was fixed with jest config adding a transformer:
// jest.config.ts
+ transform: {
+ "^.+\\.graphql$": "graphql-import-node/jest"
+ },
$ npx @vercel/ncc build bin/console.ts -o bin --v8-cache --target es2020
Hey,
I am trying to build a GraphQL API built with Typescript using
ncc
and having issues importing some.graphql
files that contain my SDL.To my understanding, I should provide a loader for this type of files, probably graphql-tag. I managed to get this to work on Webpack before, and was wondering how I can define a loader for
ncc
.For further context, I am experimenting with Zeit trying to deploy a GraphQL API in Now v2. That may not be possible, but I am also interested in making
ncc
work with.graphql
filesOutput of
ncc build api/index.ts -o dist
:Example of a
.graphql
file:I've been lurking in Zeit's Spectrum channel asking for recomendations, and apparently this is feasible, I am probably just missing something obvious.