Skip to content

Commit

Permalink
fix: allow gen to work with default graphql file and url
Browse files Browse the repository at this point in the history
  • Loading branch information
ianaya89 committed Jan 31, 2024
1 parent 63b718d commit c8afa98
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
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
DEFAULT_GRAPHQL_SCHEMA_FILE:=internal/sdk/client/graphql.schema
DEFAULT_GRAPHQL_SCHEMA_URL:=https://anywhere.altinity.cloud/api/v1/graphql.schema

GRAPHQL_SCHEMA_URL:=$(or $(GRAPHQL_SCHEMA_URL),$(DEFAULT_GRAPHQL_SCHEMA_URL))
GRAPHQL_SCHEMA_FILE:=$(or $(GRAPHQL_SCHEMA_FILE),$(DEFAULT_GRAPHQL_SCHEMA_FILE))

VERSION:=0.0.1
OS:=darwin
Expand Down Expand Up @@ -85,6 +88,7 @@ docs:

.PHONY: sdk
sdk:
@echo "Fetching GraphQL schema from ${GRAPHQL_SCHEMA_URL} to ${GRAPHQL_SCHEMA_FILE}"
curl -o ${GRAPHQL_SCHEMA_FILE} ${GRAPHQL_SCHEMA_URL}
cd internal/sdk/client && go run github.com/Yamashou/gqlgenc

Expand Down

0 comments on commit c8afa98

Please sign in to comment.