Skip to content

Instantly share code, notes, and snippets.

@oaleeapp
Created September 14, 2018 04:07
Show Gist options
  • Save oaleeapp/61e0a1339150cadaed08abe336e416db to your computer and use it in GitHub Desktop.
Save oaleeapp/61e0a1339150cadaed08abe336e416db to your computer and use it in GitHub Desktop.
Xcode build phases run script for update GraphQL APIs
# move .graphql files to ${SRCROOT}/ProjectName/GraphQL/
# move schema.json to ${SRCROOT}/ProjectName/GraphQL/schema.json
# move GraphQLAPIs.swift to ${SRCROOT}/ProjectName/Models/GraphQLAPIs.swift
npm install -g aws-appsync-codegen
aws-appsync-codegen generate "${SRCROOT}/ProjectName/GraphQL/"*.graphql --schema ${SRCROOT}/ProjectName/GraphQL/schema.json --output ${SRCROOT}/ProjectName/Models/GraphQLAPIs.swift
# output file ${SRCROOT}/ProjectName/Models/GraphQLAPIs.swift will be updated after build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment