{"id":19298827,"url":"https://github.com/studiointeract/apollo-accounts","last_synced_at":"2026-02-25T08:04:15.032Z","repository":{"id":78296986,"uuid":"76807529","full_name":"studiointeract/apollo-accounts","owner":"studiointeract","description":"Accounts for Apollo (GraphQL)","archived":false,"fork":false,"pushed_at":"2016-12-19T00:13:35.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-05T22:26:37.384Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"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/studiointeract.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":"2016-12-18T21:23:52.000Z","updated_at":"2016-12-18T21:23:52.000Z","dependencies_parsed_at":"2023-02-28T04:31:43.008Z","dependency_job_id":null,"html_url":"https://github.com/studiointeract/apollo-accounts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studiointeract%2Fapollo-accounts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studiointeract%2Fapollo-accounts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studiointeract%2Fapollo-accounts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studiointeract%2Fapollo-accounts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/studiointeract","download_url":"https://codeload.github.com/studiointeract/apollo-accounts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240400334,"owners_count":19795332,"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":[],"created_at":"2024-11-09T23:09:15.538Z","updated_at":"2026-02-25T08:04:09.994Z","avatar_url":"https://github.com/studiointeract.png","language":null,"readme":"# Accounts for Apollo (GraphQL)\r\n\r\n## Typedefs\r\n\r\nhttp://dev.apollodata.com/tools/graphql-tools/generate-schema.html#modularizing\r\n\r\n```js\r\nimport gql from 'graphql-tag';\r\nimport { Email } from 'apollo-accounts-password/typedefs';\r\nimport { Facebook } from 'apollo-accounts-facebook/typedefs';\r\n\r\nconst User = gql`\r\n  type User {\r\n    _id: ID!\r\n    emails: [Email]\r\n    facebook: Facebook\r\n  }\r\n`;\r\n\r\nconst Mutation = gql`\r\n  mutation Mutation {\r\n    signUpWithPassword(\r\n      email: String!\r\n      password: String!\r\n    ): User\r\n\r\n    signInWithPassword(\r\n      email: String!\r\n      password: String!\r\n    ): User\r\n\r\n    signUpWithFacebook(\r\n      accessToken: String!\r\n      expiresAt: String!\r\n    ): User\r\n  }\r\n`;\r\n\r\nconst Query = gql`\r\n  type Query {\r\n    user: User\r\n  }\r\n`;\r\n\r\nconst Schema = gql`\r\nschema {\r\n  query: Query\r\n  mutation: Mutation\r\n}`;\r\n\r\nexport default () =\u003e [\r\n  User,\r\n  Email,\r\n  Facebook,\r\n  InputEmail,\r\n  InputPassword,\r\n  Query,\r\n  Mutation,\r\n  Schema,\r\n];\r\n```\r\n\r\n\r\n## Resolvers\r\n\r\n```js\r\nimport uuid from 'uuid/v4';\r\nimport {\r\n  signUpWithPassword,\r\n  signInWithPassword,\r\n  validatePassword,\r\n} from 'apollo-accounts-password';\r\nimport {\r\n  Facebook,\r\n  signUpWithFacebook,\r\n} from 'apollo-accounts-facebook';\r\n\r\nconst resolveFunctions = {\r\n  Query: {\r\n    user(root, args, { user }) {\r\n      return user;\r\n    },\r\n  },\r\n\r\n  Mutation: {\r\n    signUpWithPassword(...args) {\r\n      const { email, services } = signUpWithPassword({ ...args });\r\n      // Store the user somewhere and save the service settings.\r\n      const user = {\n        _id: uuid,\n        services,\n        emails: [ email ],\n      };\r\n      Collection.insert(user);\r\n      return user;\r\n    },\r\n\r\n    signInWithPassword(...args) {\r\n      const { email, services } = signInWithPassword({ ...args });\r\n      const user = Collection.findOne({ email });\r\n      if (validatePassword({ user, ...args })) {\r\n        return user;\r\n      }\r\n    },\r\n\r\n    async signUpWithFacebook(...args) {\r\n      const {\r\n        services,\r\n        fields: {\r\n          first_name,\r\n          last_name,\r\n        },\r\n      } = await signUpWithFacebook({\r\n        ...args,\r\n        fields: {\r\n          first_name: 1,\r\n          last_name: 1,\r\n        },\r\n      });\r\n      // Store the user somewhere and save the service settings.\r\n      const user = {\r\n        _id: uuid(),\r\n        services,\r\n        first_name,\r\n        last_name,\r\n      };\r\n      Collection.insert(user);\r\n      return user;\r\n    },\r\n  },\r\n\r\n  User: {\r\n    emails: ({ emails }) =\u003e emails,\r\n    facebook: ({ userId, first_name, last_name }) =\u003e ({\r\n      userId, first_name, last_name,\r\n    }),\r\n  },\r\n\r\n  FacebookUser,\r\n};\r\n```\r\n\r\n## Middlewares\r\n\r\n```js\r\nimport {\r\n  resumeWithToken,\r\n  validateToken,\r\n} from 'apollo-accounts';\r\n\r\n\r\n\r\n```\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstudiointeract%2Fapollo-accounts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstudiointeract%2Fapollo-accounts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstudiointeract%2Fapollo-accounts/lists"}