Using a cql file and graphql #2041
-
Hi I'm new to both Cassandra and stargate. I have a cql file with my table and types definitions. Is there a way to initialize the graphql schema by using my cql file without writing create table queries? Further question, is there a way to pass in the CQL file using the prebuilt stargate docker image? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@JonathanHo16 Just to understand you have a There is no way to pass the CQL file using the Stargate as far as I know. Not sure what are you using for deploying, but Furthermore, if you intention is to use GraphQL API, you can also opt for the schema-first approach. This way you can define your GraphQL schema without having any CQL queries. You can see more about this option here: https://stargate.io/docs/stargate/1.0/developers-guide/graphql-first-using.html. |
Beta Was this translation helpful? Give feedback.
@JonathanHo16 Just to understand you have a
.cql
file with queries that initialize your CQL tables, right? I guess you can use thecqlsh
to fire those queries, using something likecqlsh -u user -p password -f file.cql host port
.There is no way to pass the CQL file using the Stargate as far as I know. Not sure what are you using for deploying, but
cqlsh
is available in cassandra docker image and you can run the command from that image.Furthermore, if you intention is to use GraphQL API, you can also opt for the schema-first approach. This way you can define your GraphQL schema without having any CQL queries. You can see more about this option here: https://stargate.io/docs/stargate/1.0/…