Chris Visser
12/08/2021, 9:50 PMDan Greaves
12/08/2021, 10:43 PMChris Visser
12/08/2021, 11:14 PMChris Visser
12/08/2021, 11:15 PMChris Visser
12/08/2021, 11:21 PMFrank
Frank
new ApolloApi(this, "MyApi", {
defaultFunctionProps: {
bundle: {
loader: {
".gql": "text"
},
},
},
});
Frank
import
the fileChris Visser
12/09/2021, 8:47 AMChris Visser
12/13/2021, 10:37 AM// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import * as schema from './schema.gql';
Frank
new ApolloApi(this, "MyApi", {
defaultFunctionProps: {
bundle: {
copyFiles: [{ from: "path/to/schema.gql", to: "path/to/schema.gql" }],
},
},
});
This way, you don’t have to import
the file. You can use fs.readFile
.Frank
copyFiles
here https://docs.serverless-stack.com/constructs/Function#copyfilesChris Visser
12/13/2021, 8:50 PM