# 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