This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@use-lens/react-apollo
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

@use-lens/react-apollo

Lens API generated code for Apollo Client in React.

Use Lens React Apollo on npm Use Lens React Apollo testnet on npm

⚠️ CAUTION

🌿 https://docs.lens.xyz/docs/introduction:

This API is beta and not production complete yet, which means that we could change schemas and endpoints at any time without warning or notice to you. When this API is production ready, we will remove this beta warning and will endeavor to ensure that there are no changes going forward unless a major change to the protocol itself is required.

Lens API is not production complete, and so is @use-lens/*. Please, keep this in mind when going to production.

In case of breaking changes, please, visit main README.md's FAQ

There is an explanation of how I see the best use of @use-lens/* at this point in the main README.md

🤓 Usage

All packages and CLI have 2 versions/dist-tags: @testnet and @latest. Install @testnet version only if you need some functionality from it(currently, it is only createProfile).

  • Install package
npm install --save @use-lens/react-apollo
import {
  useAuthenticateMutation,
  useChallengeLazyQuery,
  useGlobalProtocolStatsQuery
} from '@use-lens/react-apollo';

const SomeComponent = () => {
  // component's code
  const [loadChallenge] = useChallengeLazyQuery();
  const [authenticate] = useAuthenticateMutation();

  const { data, error, loading } = useGlobalProtocolStatsQuery();
  
  return // render data from Lens API.
}

Workflow

  • decide what you want to implement
  • go to 🌿 https://docs.lens.xyz to check what query or mutation you need to use
  • import from @use-lens/react-apollo what you need
    • document(query or mutation)
    • request /response types

Detailed information about what is produced can be found here:

https://www.the-guild.dev/graphql/codegen/plugins/typescript/typescript-react-apollo

👨‍🏫 Example

https://github.com/use-lens/use-lens/tree/main/examples/react-apollo

🔎 LICENSE

MIT. The full license text can be found in the LICENSE file.

...The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

Last update

2022/12/07

Package Sidebar

Install

npm i @use-lens/react-apollo

Weekly Downloads

26

Version

1.0.5

License

MIT

Unpacked Size

17.4 MB

Total Files

10

Last publish

Collaborators

  • andriishupta