Compare commits

...

7 Commits

Author SHA1 Message Date
Szilárd Dóró
f7ddafdf05 Merge pull request #657 from nhost/changeset-release/main
chore: update versions
2022-06-01 15:26:43 +02:00
github-actions[bot]
f86b707d34 chore: update versions 2022-06-01 13:23:25 +00:00
Szilárd Dóró
d281665424 Merge pull request #655 from nhost/fix/missing-modules
fix: `@nhost/react-apollo` imports
2022-06-01 15:22:21 +02:00
Szilárd Dóró
24659b2979 fixed build warning related to unknown globals 2022-06-01 14:52:36 +02:00
Szilárd Dóró
ef8c8f9cd4 fixed @nhost/react-apollo imports 2022-06-01 14:47:04 +02:00
Johan Eliasson
bc526e70ef Merge pull request #651 from gdangelo/docs/quickstarts-redwoodjs
docs: Add skip option to useQuery call to skip query if id is falsy
2022-06-01 14:30:23 +02:00
Grégory D'Angelo
c1c7ceb319 docs: Add skip option to useQuery call to skip query if id is falsy 2022-06-01 13:20:41 +02:00
6 changed files with 14 additions and 6 deletions

View File

@@ -70,6 +70,7 @@ export default defineConfig({
'@apollo/client': '@apollo/client',
'@apollo/client/core/index.js': '@apollo/client/core',
'@apollo/client/link/context/index.js': '@apollo/client/link/context',
'@apollo/client/react/index.js': '@apollo/client/react',
'@apollo/client/link/subscriptions/index.js': '@apollo/client/link/subscriptions',
'@apollo/client/utilities/index.js': '@apollo/client/utilities',
'graphql-ws': 'graphql-ws',

View File

@@ -1090,7 +1090,8 @@ export function UserProvider({ children = null }) {
const { userMetadata } = useAuth()
const { loading, error, data } = useQuery(GET_USER_QUERY, {
variables: { id: userMetadata?.id }
variables: { id: userMetadata?.id },
skip: !userMetadata?.id
})
const user = data?.user

View File

@@ -1,5 +1,11 @@
# @nhost/react-apollo
## 4.2.13
### Patch Changes
- ef8c8f9c: fixed imports in `@nhost/react-apollo`
## 4.2.12
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/react-apollo",
"version": "4.2.12",
"version": "4.2.13",
"description": "Nhost React Apollo client",
"license": "MIT",
"keywords": [

View File

@@ -3,10 +3,9 @@ import {
OperationVariables,
QueryHookOptions,
SubscriptionHookOptions,
TypedDocumentNode,
useQuery,
useSubscription
TypedDocumentNode
} from '@apollo/client'
import { useQuery, useSubscription } from '@apollo/client/react/index.js'
import { useAuthenticated } from '@nhost/react'
export function useAuthQuery<TData = any, TVariables = OperationVariables>(

View File

@@ -1,6 +1,7 @@
import React, { useEffect, useState } from 'react'
import { ApolloClient, ApolloProvider } from '@apollo/client'
import { ApolloClient } from '@apollo/client/core/index.js'
import { ApolloProvider } from '@apollo/client/react/index.js'
import { createApolloClient, NhostApolloClientOptions } from '@nhost/apollo'
export const NhostApolloProvider: React.FC<