Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(generate): first attempt at getting tutone to generate types #17

Merged
merged 2 commits into from
Jul 13, 2020

Conversation

sanderblue
Copy link
Contributor

@sanderblue sanderblue commented Jul 10, 2020

Still lots of work to be done, but makin' moves here.

Future work (#11):

  • One config file
  • POC of using a "provider" pattern (keep business logic separate from program logic)

To test it out

  1. Create a .tutone.yml and .generate.yml config file in the project root
  2. Compile the tutone binary with make compile-only
  3. Run ./bin/darwin/tutone generate -c .tutone.yml -d .generate.yml -l debug

.tutone.yml

---
# Log level for running tutone
# Default: info
log_level: debug

# File to store a copy of the schema
# Default: schema.json
schema_file: schema.json

# GraphQL endpoint to query for schema
# Required
endpoint: https://api.newrelic.com/graphql

# How to authenticate to the API
auth:
  # Header set with the API key for authentication
  # Default: Api-Key
  header: Api-Key

  # Environment variable to get the API key from
  # Default: TUTONE_API_KEY
  api-key-env: NEW_RELIC_API_KEY

generate:
  # Name of the file within a package to write types
  # Default: types.go
  types_file: types.go

.generate.yml

---
packages:
  - name: alerts
    path: pkg/alerts
    types:
      - name: AlertsMutingRuleConditionInput
      # ... add more types as needed

@CLAassistant
Copy link

CLAassistant commented Jul 10, 2020

CLA assistant check
All committers have signed the CLA.

@sanderblue sanderblue marked this pull request as ready for review July 13, 2020 19:30
@sanderblue sanderblue changed the title feat(generate): WIP - first attempt at getting tutone to generate types feat(generate): first attempt at getting tutone to generate types Jul 13, 2020
@sanderblue sanderblue merged commit 324291d into master Jul 13, 2020
@sanderblue sanderblue deleted the feat/typegen-as-a-service branch July 13, 2020 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants