Makefile 715 B

123456789101112131415161718192021222324252627
  1. # See http://clarkgrubb.com/makefile-style-guide
  2. MAKEFLAGS += --warn-undefined-variables
  3. SHELL := bash
  4. .SHELLFLAGS := -eu -o pipefail -c
  5. .DEFAULT_GOAL := all
  6. .DELETE_ON_ERROR:
  7. .SUFFIXES:
  8. include .env
  9. .PHONY: all
  10. all: supergraph add-context
  11. .PHONY: supergraph
  12. supergraph:
  13. -@echo "-> $@"
  14. rover supergraph compose --config config.yaml > superschema.graphql
  15. #
  16. .PHONY: add-context
  17. add-context:
  18. -@echo "-> $@"
  19. @echo -e "\n\n$$(cat ext/in_context.graphql)" >> superschema.graphql
  20. @sed 's/type Query/type Query\n @inContext/' superschema.graphql > prod.graphql
  21. @cp prod.graphql superschema.graphql
  22. @sed 's/type Mutation/type Mutation\n @inContext/' superschema.graphql > prod.graphql
  23. @rm superschema.graphql