{"id":14383391,"url":"https://github.com/sophiabits/graphql-sunset","last_synced_at":"2025-07-17T09:30:58.985Z","repository":{"id":252583198,"uuid":"838664981","full_name":"sophiabits/graphql-sunset","owner":"sophiabits","description":"Easily add support for the `Sunset` header to your GraphQL server to better communicate upcoming breaking changes.","archived":false,"fork":false,"pushed_at":"2024-08-11T02:59:37.000Z","size":51,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-22T14:24:11.393Z","etag":null,"topics":["apis","graphql","sunset"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sophiabits.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-08-06T05:36:04.000Z","updated_at":"2025-04-01T17:28:14.000Z","dependencies_parsed_at":"2025-05-29T07:32:10.041Z","dependency_job_id":null,"html_url":"https://github.com/sophiabits/graphql-sunset","commit_stats":null,"previous_names":["sophiabits/graphql-sunset"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sophiabits/graphql-sunset","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sophiabits%2Fgraphql-sunset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sophiabits%2Fgraphql-sunset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sophiabits%2Fgraphql-sunset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sophiabits%2Fgraphql-sunset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sophiabits","download_url":"https://codeload.github.com/sophiabits/graphql-sunset/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sophiabits%2Fgraphql-sunset/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265589068,"owners_count":23793461,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apis","graphql","sunset"],"created_at":"2024-08-28T18:00:21.462Z","updated_at":"2025-07-17T09:30:58.663Z","avatar_url":"https://github.com/sophiabits.png","language":"TypeScript","funding_links":[],"categories":["Implementations"],"sub_categories":["JavaScript/TypeScript"],"readme":"# graphql-sunset\n\nEasily add support for the [`Sunset` header](http://sophiabits.com/blog/what-is-the-http-sunset-header) to your GraphQL server to better communicate upcoming breaking changes.\n\n## Usage\n\n1. Add a `sunset` directive to your schema.\n    ```graphql\n    directive @sunset(\n      url: String!\n      when: String!\n    ) on FIELD_DEFINITION\n\n    # ...\n    ```\n\n    \u003e 💡 If you prefer more specific types (e.g. `Instant!` / `URL!`), then you can use them. If your GraphQL server parses these fields to something other than a string, you will need to specify a custom `parseDirectiveArgs` function when instantiating the plugin.\n\n2. Apply it to a field:\n    ```graphql\n    type Query {\n      greeting: String @sunset(\n        url: \"https://docs.your-app.com/removal-of-greeting\"\n        when: \"2025-01-01T00:00:00.000Z\"\n      )\n    }\n    ```\n\n3. Add the plugin to your Apollo server.\n    ```typescript\n    import { ApolloSunsetPlugin } from 'graphql-sunset';\n\n    // ...\n\n    const server = new ApolloServer({\n      // ...\n      plugins: [\n        new ApolloSunsetPlugin({\n          directiveName: 'sunset',\n          // parseDirectiveArgs\n        }),\n      ],\n    });\n    ```\n\n4. Run a GraphQL operation, and see the `Link` and `Sunset` headers get populated:\n    ```\n    $ curl --include --request POST \\\n        --header 'content-type: application/json' \\\n        --url http://localhost:4000/ \\\n        --data '{\"query\":\"query ExampleQuery {\\n  greeting\\n}\"}'\n    HTTP/1.1 200 OK\n    ...\n    sunset: Wed, 01 Jan 2025 00:00:00 GMT\n    link: \u003chttps://docs.your-app.com/removal-of-greeting\u003e; rel=\"sunset\"\n    ...\n\n    {\"data\":{\"greeting\":\"Bar\"}}\n    ```\n\n## Roadmap\n\n- [x] Output fields\n- [x] Field arguments\n- [x] Input object fields\n- [ ] Enum values\n- [ ] Envelop server plugin\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsophiabits%2Fgraphql-sunset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsophiabits%2Fgraphql-sunset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsophiabits%2Fgraphql-sunset/lists"}