Skip to content

Commit

Permalink
refactor: use public api graphql schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
ianaya89 committed Dec 5, 2023
1 parent 2c97a4a commit 744c678
Show file tree
Hide file tree
Showing 4 changed files with 2,213 additions and 11 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
PROVIDER_BIN:=$(shell basename `git rev-parse --show-toplevel`)
PROVIDER_NAME:=$(shell echo $(PROVIDER_BIN) | sed 's/terraform-provider-//g')
PROVIDER_DIRECTORY:=~/.terraform.d/plugins/local/altinity/${PROVIDER_NAME}
GRAPHQL_SCHEMA_URL?=https://anywhere.altinity.cloud/api/v1/graphql.schema
GRAPHQL_SCHEMA_FILE:=internal/sdk/client/graphql.schema

VERSION:=0.0.1
OS:=darwin
Expand Down Expand Up @@ -38,14 +40,15 @@ local: build
cd ${LOCAL_DIRECTOY} && TF_LOG=TRACE terraform init -upgrade

.PHONY: gen
gen: docs
gen: sdk docs

.PHONY: docs
docs:
go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs

.PHONY: sdk
sdk:
curl -o ${GRAPHQL_SCHEMA_FILE} ${GRAPHQL_SCHEMA_URL}
cd internal/sdk/client && go run github.com/Yamashou/gqlgenc

.PHONY: fmt
Expand Down
2 changes: 1 addition & 1 deletion internal/sdk/client/gqlgenc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ models:
Int:
model: github.com/99designs/gqlgen/graphql.Int64
schema:
- https://anywhere.dev.altinity.cloud/api/v1/graphql.schema
- "./graphql.schema"
query:
- "./*.graphql"
generate:
Expand Down
Loading

0 comments on commit 744c678

Please sign in to comment.