123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165 |
- # See http://clarkgrubb.com/makefile-style-guide
- MAKEFLAGS += --warn-undefined-variables
- SHELL := bash
- .SHELLFLAGS := -eu -o pipefail -c
- .DEFAULT_GOAL := all
- .DELETE_ON_ERROR:
- .SUFFIXES:
- include .env
- .PHONY: all
- all: supergraph add-context generate
- .PHONY: supergraph
- supergraph:
- -@echo "-> $@"
- @cat subgraph/customer.tpl \
- ext/customer.graphql \
- \
- ext/gqlgen.graphql \
- ext/enum.graphql \
- ext/error.graphql \
- ext/interface.graphql \
- ext/localization.graphql \
- ext/location.graphql \
- ext/page.graphql \
- ext/property.graphql \
- ext/publication.graphql \
- ext/scalar.graphql \
- ext/translation.graphql \
- ext/union.graphql \
- \
- ext/app.graphql \
- ext/company.graphql \
- ext/delivery.graphql \
- ext/event.graphql \
- ext/mail.graphql \
- ext/marketing.graphql \
- ext/media.graphql \
- ext/meta.graphql \
- ext/money.graphql \
- ext/order.graphql \
- ext/product.graphql \
- ext/rbac.graphql \
- ext/shop.graphql \
- > subgraph/customer.graphql
- @cat subgraph/product.tpl \
- ext/product.graphql \
- \
- ext/gqlgen.graphql \
- ext/enum.graphql \
- ext/error.graphql \
- ext/interface.graphql \
- ext/localization.graphql \
- ext/location.graphql \
- ext/page.graphql \
- ext/property.graphql \
- ext/publication.graphql \
- ext/scalar.graphql \
- ext/translation.graphql \
- ext/union.graphql \
- \
- ext/app.graphql \
- ext/company.graphql \
- ext/customer.graphql \
- ext/delivery.graphql \
- ext/event.graphql \
- ext/fulfillment.graphql \
- ext/marketing.graphql \
- ext/media.graphql \
- ext/meta.graphql \
- ext/money.graphql \
- ext/order.graphql \
- ext/rbac.graphql \
- ext/shop.graphql \
- > subgraph/product.graphql
- @cat subgraph/shop.tpl \
- ext/shop.graphql \
- \
- ext/gqlgen.graphql \
- ext/enum.graphql \
- ext/error.graphql \
- ext/event.graphql \
- ext/interface.graphql \
- ext/localization.graphql \
- ext/location.graphql \
- ext/page.graphql \
- ext/property.graphql \
- ext/publication.graphql \
- ext/scalar.graphql \
- ext/translation.graphql \
- ext/union.graphql \
- \
- ext/alert.graphql \
- ext/app.graphql \
- ext/channel.graphql \
- ext/company.graphql \
- ext/customer.graphql \
- ext/delivery.graphql \
- ext/fulfillment.graphql \
- ext/mail.graphql \
- ext/market.graphql \
- ext/marketing.graphql \
- ext/media.graphql \
- ext/meta.graphql \
- ext/money.graphql \
- ext/order.graphql \
- ext/product.graphql \
- ext/rbac.graphql \
- > subgraph/shop.graphql
- @cat subgraph/order.tpl \
- \
- ext/gqlgen.graphql \
- ext/enum.graphql \
- ext/error.graphql \
- ext/event.graphql \
- ext/interface.graphql \
- ext/localization.graphql \
- ext/location.graphql \
- ext/page.graphql \
- ext/property.graphql \
- ext/publication.graphql \
- ext/scalar.graphql \
- ext/translation.graphql \
- ext/union.graphql \
- \
- ext/alert.graphql \
- ext/app.graphql \
- ext/channel.graphql \
- ext/company.graphql \
- ext/customer.graphql \
- ext/delivery.graphql \
- ext/fulfillment.graphql \
- ext/mail.graphql \
- ext/marketing.graphql \
- ext/meta.graphql \
- ext/media.graphql \
- ext/money.graphql \
- ext/order.graphql \
- ext/product.graphql \
- ext/rbac.graphql \
- ext/shop.graphql \
- > subgraph/order.graphql
- @rover supergraph compose --config config.yaml > superschema.graphql
- .PHONY: add-context
- add-context:
- -@echo "-> $@"
- @sed -r '/directive @inContext(.+)/d' superschema.graphql > prod.graphql
- @echo -e "\n\n$$(cat ext/in_context.graphql)" >> prod.graphql
- @cp prod.graphql superschema.graphql
- @sed 's/type Query/type Query\n @inContext/' superschema.graphql > prod.graphql
- @cp prod.graphql superschema.graphql
- @sed 's/type Mutation/type Mutation\n @inContext/' superschema.graphql > prod.graphql
- @rm superschema.graphql
- .PHONY: generate
- generate:
- -@echo "-> $@"
- -rm -rf graph
- @go run gshopper.com/gshopify/admin-api/cmd -m all
|