Coder Social home page Coder Social logo

update-graphql-schema's Introduction

Update GraphQL Schema ๐Ÿš€

A Github Action that downloads your GraphQL schema from introspection and/or the Studio registry and opens a pull request if anything changed.

This action supports converting an introspection schema to SDL and vice-versa based on the file extension. We recommend using .graphqls to convert to SDL.

Repository configuration

Allow Workflows to write to your repository and create pull requests:

Configuring with introspection

name: Update GraphQL schema
# Check every night at midnight
on:
  schedule:
    - cron: "0 0 * * *"

jobs:
  update:
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v2
      - uses: apollographql/update-graphql-schema@main
        with:
          endpoint: "https://example.com/graphql"
          schema: "src/main/graphql/schema.graphqls"
          
          #  Optional HTTP settings for the download
          headers: '{"Authorization": "Bearer $token", "User-Agent": "MyAction"}' # default: ""
          insecure: "false" # default: "false"

          # Optional pull request settings        
          branch: "graphql-schema" # default: "update-schema"
          remote: "origin" # default: "origin"
          token: "abc123" # Default: GITHUB_TOKEN

          # Optional commit settings
          commit_user_name: My GitHub Actions Bot # defaults to "github-actions[bot]"
          commit_user_email: [email protected] # defaults to "github-actions[bot]@users.noreply.github.com"
          commit_author: Author <[email protected]> # defaults to author of the commit that triggered the run
          commit_message: Automated Commit # defaults to "Update GraphQL Schema"

Configuring with the Studio registry

name: Update GraphQL schema
on:
  schedule:
    - cron: "0 0 * * *"

jobs:
  update:
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v2
      - uses: apollographql/update-graphql-schema@main
        with:
          key: "service:fullstack-tutorial:abc123"
          schema: "src/main/graphql/schema.graphqls"

          # Optional Studio registry settings
          graph: "fullstack-tutorial" # defaults to being parsed from the key
          graph_variant: "production" # default: "current"

          # Other optional settings are the same as for introspection

update-graphql-schema's People

Contributors

bod avatar martinbonnin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.