{"id":18224907,"url":"https://github.com/errorpro/relay-compose","last_synced_at":"2025-10-30T14:22:39.071Z","repository":{"id":56378404,"uuid":"94475031","full_name":"ErrorPro/relay-compose","owner":"ErrorPro","description":"This is HOC for relay modern to work with сomposable components.","archived":false,"fork":false,"pushed_at":"2023-04-18T16:29:18.000Z","size":82,"stargazers_count":29,"open_issues_count":2,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-03T00:58:13.348Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ErrorPro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2017-06-15T20:10:51.000Z","updated_at":"2020-11-25T05:54:38.000Z","dependencies_parsed_at":"2025-04-03T06:31:27.023Z","dependency_job_id":"92229d98-cfff-4826-abb4-c991b0b5dfc7","html_url":"https://github.com/ErrorPro/relay-compose","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ErrorPro/relay-compose","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErrorPro%2Frelay-compose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErrorPro%2Frelay-compose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErrorPro%2Frelay-compose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErrorPro%2Frelay-compose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ErrorPro","download_url":"https://codeload.github.com/ErrorPro/relay-compose/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErrorPro%2Frelay-compose/sbom","scorecard":{"id":46663,"data":{"date":"2025-08-11","repo":{"name":"github.com/ErrorPro/relay-compose","commit":"0b713f673c8d84c2f5143d46a3ce1501cac834d5"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"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":"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":"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":"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":"Code-Review","score":3,"reason":"Found 6/20 approved changesets -- score normalized to 3","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":"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":"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":"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":"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":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"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 15 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"}},{"name":"Vulnerabilities","score":0,"reason":"30 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-c6rq-rjc2-86v2","Warn: Project is vulnerable to: GHSA-hr2v-3952-633q","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574","Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-6g33-f262-xjp4","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-j44m-qm6p-hp7m","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-14T22:55:22.031Z","repository_id":56378404,"created_at":"2025-08-14T22:55:22.031Z","updated_at":"2025-08-14T22:55:22.031Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278717449,"owners_count":26033542,"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","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-04T02:05:11.477Z","updated_at":"2025-10-07T03:54:53.739Z","avatar_url":"https://github.com/ErrorPro.png","language":"JavaScript","readme":"# Relay-compose\n\nThis is a HOC for relay modern to work with сomposable react components.\n\nYou probably want to use this when you work with smart and dumb components and you need to compose relay data fetching in your smart component and pass it down to dumb component.\n\n# Setup\n\n`npm install --save relay-compose`\n\nSet relay [environment](https://facebook.github.io/relay/docs/relay-environment.html) using `setEnvironment` in your entry point. For example in `client.js`:\n\n```js\nimport { setEnvironment } from 'relay-compose';\nimport relayEnv from './createRelayEnvironment'\n\nsetEnvironment(relayEnv);\n```\n\nAnd now you are ready to use it.\n\n# Examples\n## FragmentContainer\n\n```js\nimport {\n  graphql,\n} from 'react-relay';\nimport { fragment } from 'relay-compose';\n\nimport Persons from './Persons';\n\nexport default compose(\n  fragment(graphql`\n    fragment PersonsContainerDesc on Person @relay(plural: true) {\n      id\n      title\n    }\n  `),\n  connect(mapProps, mapDispatch, mergeProps),\n)(Persons);\n```\n\n## Query renderer(root)\n\n```js\nimport {\n  graphql,\n} from 'react-relay';\nimport { queryRenderer } from 'relay-compose';\n\nimport PersonsInfoPage from './PersonsInfoPage';\nimport { PersonsContainer } from '../Persons';\n\nexport default compose(\n  queryRenderer(graphql`\n    query PersonsInfoPageContainerQuery {\n      Person {\n        ...PersonsContainerDesc\n      }\n    }\n  `),\n  mapProps(props =\u003e ({\n    persons: \u003cPersonsContainer data={props.Person} /\u003e,\n  })),\n)(PersonsInfoPage);\n```\n\n## Mutations\n\n```js\nimport { createMutation } from 'relay-compose';\n\nexport default compose(\n  mapProps(props =\u003e ({\n    onSubmit: (data) =\u003e {\n      createMutation(graphql`\n        mutation MyComponentContainerMutation($input: MyInput!) {\n          createUser(input: $input) {\n            clientMutationId\n          }\n        }\n      `, {\n        variables: {\n          input: data,\n        },\n        configs: [{\n          type: 'RANGE_ADD',\n          ...myConfig,\n        }],\n      }).then(res =\u003e console.log(res);\n    },\n  })),\n  reduxForm({\n    form: 'MyForm',\n  }),\n)(MyForm);\n```\n\n## RefetchContainer\n\n```js\nimport { queryRenderer, refetchContainer } from 'relay-compose';\n\nexport default compose(\n  queryRenderer(graphql`\n    query appQuery {\n      viewer {\n        ...Test_viewer\n      }\n    }\n  `),\n  refetchContainer(\n    {\n      viewer: graphql.experimental`\n        fragment Test_viewer on User\n        @argumentDefinitions(\n          name: { type: String }\n        ) {\n          id\n          firstName\n          lastName\n        }\n      `,\n    },\n    graphql.experimental`\n      query TestQuery($name: String!) {\n        viewer {\n          ...Test_viewer @arguments(name: $name)\n        }\n      }\n    `,\n  ),\n)(Test);\n```\n\n## PaginationContainer\n\n```js\nimport { queryRenderer, paginationContainer } from 'relay-compose';\n\nexport default compose(\n  queryRenderer(\n    query songsContainerQuery(\n      $count: Int!\n      $cursor: String\n    ) {\n      ...songsContainer\n    }\n  `),\n  paginationContainer(\n    fragment songsContainer on Query {\n      songs(\n        first: $count,\n        after: $cursor,\n      ) @connection(key: \"songsContainer_songs\") {\n        edges {\n          node {\n            audioId,\n            name,\n            coverImageUrl,\n            artist,\n            likes,\n            dislikes,\n          }\n        }\n      }\n    }\n  `),\n  {\n    direction: 'forward',\n    query: graphql`\n      query songsContainerForwardQuery(\n        $count: Int!\n        $cursor: String\n      ) {\n        ...songsContainer,\n      }\n    `,\n    getVariables: (_, { count, cursor }) =\u003e ({\n      count,\n      cursor,\n    }),\n  }),\n)(Test);\n```\n\n## Subscriptions\n```js\nimport { graphql } from 'react-relay';\nimport { createSubscription } from 'relay-compose';\n\nconst subscription = graphql`\n  subscription UnreadMessageNotificationSubscription($input: String) {\n    unreadMessageNotification(input: $input) {\n      unreadMessage\n    }\n  }\n`;\n\nfunction create(input) {\n  return createSubscription(subscription, { input });\n}\n\nexport default {\n  create,\n};\n```\n\n# Information\nThis project is still in WIP. You are welcome to participate to it.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferrorpro%2Frelay-compose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferrorpro%2Frelay-compose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferrorpro%2Frelay-compose/lists"}