{"id":13563295,"url":"https://github.com/functionalfoundry/graphqlws","last_synced_at":"2026-01-17T03:45:03.810Z","repository":{"id":47351850,"uuid":"112355640","full_name":"functionalfoundry/graphqlws","owner":"functionalfoundry","description":"Implementation of the GraphQL over WebSocket protocol in Go.","archived":false,"fork":false,"pushed_at":"2021-05-02T11:41:08.000Z","size":41,"stargazers_count":151,"open_issues_count":11,"forks_count":26,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-08-13T22:02:29.156Z","etag":null,"topics":["backend","go","golang","graphql","server","websockets"],"latest_commit_sha":null,"homepage":"https://godoc.org/github.com/functionalfoundry/graphqlws","language":"Go","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/functionalfoundry.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-28T15:49:01.000Z","updated_at":"2025-07-08T11:36:21.000Z","dependencies_parsed_at":"2022-08-21T23:21:15.852Z","dependency_job_id":null,"html_url":"https://github.com/functionalfoundry/graphqlws","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/functionalfoundry/graphqlws","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/functionalfoundry%2Fgraphqlws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/functionalfoundry%2Fgraphqlws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/functionalfoundry%2Fgraphqlws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/functionalfoundry%2Fgraphqlws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/functionalfoundry","download_url":"https://codeload.github.com/functionalfoundry/graphqlws/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/functionalfoundry%2Fgraphqlws/sbom","scorecard":{"id":413812,"data":{"date":"2025-08-11","repo":{"name":"github.com/functionalfoundry/graphqlws","commit":"7bc58903ce7b98abd2b48b6c0e833d30bef2c781"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.7,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":5,"reason":"Found 11/20 approved changesets -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 24 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T23:19:25.075Z","repository_id":47351850,"created_at":"2025-08-18T23:19:25.076Z","updated_at":"2025-08-18T23:19:25.076Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28493674,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T02:39:23.645Z","status":"ssl_error","status_checked_at":"2026-01-17T02:34:19.649Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["backend","go","golang","graphql","server","websockets"],"created_at":"2024-08-01T13:01:17.486Z","updated_at":"2026-01-17T03:45:03.793Z","avatar_url":"https://github.com/functionalfoundry.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"**Note: We're looking for a new maintainer for `graphqlws`. Please reach out via jannis@thegraph.com if you're interested.**\n\n---\n\n# graphqlws\n\nImplementation of the [GraphQL over WebSocket protocol] in Go.\nBrought to you by [Functional Foundry](https://functionalfoundry.com).\n\n[API Documentation](https://godoc.org/github.com/functionalfoundry/graphqlws)\n\n[![Build Status](https://travis-ci.org/functionalfoundry/graphqlws.svg?branch=master)](https://travis-ci.org/functionalfoundry/graphqlws)\n[![Go Report](https://goreportcard.com/badge/github.com/functionalfoundry/graphqlws)](https://goreportcard.com/report/github.com/functionalfoundry/graphqlws)\n\n## Getting started\n\n1. Install dependencies:\n   ```sh\n   go get github.com/sirupsen/logrus\n   go get github.com/x-cray/logrus-prefixed-formatter\n   go get github.com/google/uuid\n   go get github.com/gorilla/websocket\n   go get github.com/graphql-go/graphql\n   ```\n2. Clone the repository:\n   ```sh\n   mkdir -p \"$GOPATH/src/github.com/functionalfoundry\"\n   cd \"$GOPATH/src/github.com/functionalfoundry\"\n   git clone https://github.com/functionalfoundry/graphqlws\n   ```\n4. Run the tests:\n   ```sh\n   cd graphqlws\n   go test\n   ```\n3. Run the example server:\n   ```sh\n   go run graphqlws/examples/server\n   ```\n\n## Usage\n\n### Setup\n\n```go\npackage main\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/functionalfoundry/graphqlws\"\n\t\"github.com/graphql-go/graphql\"\n)\n\nfunc main() {\n\t// Create a GraphQL schema\n\tschema, err := graphql.NewSchema(...)\n\n\t// Create a subscription manager\n\tsubscriptionManager := graphqlws.NewSubscriptionManager(\u0026schema)\n\n\t// Create a WebSocket/HTTP handler\n\tgraphqlwsHandler := graphqlws.NewHandler(graphqlws.HandlerConfig{\n\t\t// Wire up the GraphqL WebSocket handler with the subscription manager\n\t\tSubscriptionManager: subscriptionManager,\n\n\t\t// Optional: Add a hook to resolve auth tokens into users that are\n\t\t// then stored on the GraphQL WS connections\n\t\tAuthenticate: func(authToken string) (interface{}, error) {\n\t\t\t// This is just a dumb example\n\t\t\treturn \"Joe\", nil\n\t\t},\n\t})\n\n\t// The handler integrates seamlessly with existing HTTP servers\n\thttp.Handle(\"/subscriptions\", graphqlwsHandler)\n\thttp.ListenAndServe(\":8080\", nil)\n}\n```\n\n### Working with subscriptions\n\n```go\n// This assumes you have access to the above subscription manager\nsubscriptions := subscriptionManager.Subscriptions()\n\nfor conn, _ := range subscriptions {\n\t// Things you have access to here:\n\tconn.ID()   // The connection ID\n\tconn.User() // The user returned from the Authenticate function\n\n\tfor _, subscription := range subscriptions[conn] {\n\t\t// Things you have access to here:\n\t\tsubscription.ID            // The subscription ID (unique per conn)\n\t\tsubscription.OperationName // The name of the operation\n\t\tsubscription.Query         // The subscription query/queries string\n\t\tsubscription.Variables     // The subscription variables\n\t\tsubscription.Document      // The GraphQL AST for the subscription\n\t\tsubscription.Fields        // The names of top-level queries\n\t\tsubscription.Connection    // The GraphQL WS connection\n\n\t\t// Prepare an execution context for running the query\n\t\tctx := context.Context()\n\n\t\t// Re-execute the subscription query\n\t\tparams := graphql.Params{\n\t\t\tSchema:         schema, // The GraphQL schema\n\t\t\tRequestString:  subscription.Query,\n\t\t\tVariableValues: subscription.Variables,\n\t\t\tOperationName:  subscription.OperationName,\n\t\t\tContext:        ctx,\n\t\t}\n\t\tresult := graphql.Do(params)\n\n\t\t// Send query results back to the subscriber at any point\n\t\tdata := graphqlws.DataMessagePayload{\n\t\t\t// Data can be anything (interface{})\n\t\t\tData:   result.Data,\n\t\t\t// Errors is optional ([]error)\n\t\t\tErrors: graphqlws.ErrorsFromGraphQLErrors(result.Errors),\n\t\t}\n\t\tsubscription.SendData(\u0026data)\n\t}\n}\n```\n\n### Logging\n\n`graphqlws` uses [logrus](https://github.com/sirupsen/logrus) for logging.\nIn the future we might remove those logs entirely to leave logging entirely to developers\nusing `graphqlws`. Given the current solution, you can control the logging level of\n`graphqlws` by setting it through `logrus`:\n\n```go\nimport (\n  log \"github.com/sirupsen/logrus\"\n)\n\n...\n\nlog.SetLevel(log.WarnLevel)\n```\n\n## License\n\nCopyright © 2017-2019 Functional Foundry, LLC.\n\nLicensed under the [MIT License](LICENSE.md).\n\n[graphql over websocket protocol]: https://github.com/apollographql/subscriptions-transport-ws/blob/master/PROTOCOL.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunctionalfoundry%2Fgraphqlws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffunctionalfoundry%2Fgraphqlws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunctionalfoundry%2Fgraphqlws/lists"}