Luke.Adams
01/28/2018, 9:32 PMschema.graphql
that currently just has imports from a number of other .graphql
files. Also I am noticing that the codegen pieces also need to inspect my .graphql
files which currently require introspection from graphql-import
as they contain imports. I feel like I am missing a piece here that bridges the codegen to complete the creation of TypeScript types.agartha
01/28/2018, 9:58 PM.graphqlconfig
to specify your configuration, you can use the graphql prepare
step to both process your schema imports, and generate static bindingsLuke.Adams
01/28/2018, 10:10 PMLuke.Adams
01/28/2018, 10:11 PMgraphql prepare --bundle --bindings -o generated -s -p dr-api
✖ Processing schema imports for project dr-api...
Syntax Error: Unexpected <EOF>
Luke.Adams
01/28/2018, 10:11 PM➜ dr-api git:(master) ✗ tree src
src
├── index.ts
├── schema.graphql
├── schema.ts
├── transformation
│ ├── imageObjectDetection
│ │ ├── resolvers.ts
│ │ └── schema.graphql
│ ├── resolvers.ts
│ └── schema.graphql
└── utils
├── ArgsMapper.ts
├── DynamoList.ts
├── db.ts
└── typeTools.ts
Luke.Adams
01/28/2018, 10:11 PM{
"projects": {
"dr-api": {
"schemaPath": "src/schema.graphql",
"extensions": {
"endpoints": {
"dev": "<http://localhost:4001/graphql>"
}
}
}
}
}
Luke.Adams
01/28/2018, 10:12 PM# import * from "transformation/schema.graphql"
# import * from "transformation/imageObjectDetection/schema.graphql"
Luke.Adams
01/28/2018, 10:13 PMimport { importSchema } from "graphql-import";
import { makeExecutableSchema } from "graphql-tools";
import { TransformationResolver } from "./transformation/resolvers";
import { ImageObjectDetectionResolver } from "./transformation/imageObjectDetection/resolvers";
const typeDefs = importSchema("src/schema.graphql");
console.log(typeDefs);
const resolvers = {
...TransformationResolver,
...ImageObjectDetectionResolver
};
const schema = makeExecutableSchema({ typeDefs, resolvers });
export default schema;
agartha
01/28/2018, 10:13 PMgraphql-cli
are you using?agartha
01/28/2018, 10:15 PMgraphql-cli
doesn't support empty schemas yetagartha
01/28/2018, 10:16 PMtype Dummy { dummy: String }
to your schema.graphql
to make sure that is the issue?Luke.Adams
01/28/2018, 10:16 PMLuke.Adams
01/28/2018, 10:20 PM-g bindings-ts
agartha
01/28/2018, 10:20 PMagartha
01/28/2018, 10:25 PMgraphql-cli
(v2.12.5), so if you can install that one globally, it should support an empty root schemaLuke.Adams
01/28/2018, 10:26 PMLuke.Adams
01/28/2018, 10:29 PMagartha
01/28/2018, 10:29 PMgraphql-cli
...