Using @defer under an array field will return multiple patches. Patches are unique combinations of label and path
{
items {
id
...frag @defer(label: "my-label")
}
}| import React from 'react'; | |
| import { render, cleanup } from '@testing-library/react'; | |
| import { MockPayloadGenerator } from 'relay-test-utils'; | |
| import UserListDefault from '../UserList'; | |
| import Environment from 'path/to/Environment'; | |
| afterEach(cleanup); | |
| describe('<UserList />', () => { | |
| it('should reject query', () => { |
| import { | |
| Environment, | |
| Network, | |
| RecordSource, | |
| Store, | |
| } from 'relay-runtime'; | |
| import { RelayTransactionLogger } from './RelayTransactionLogger'; | |
| // Define a function that fetches the results of an operation (query/mutation/etc) |
| import { useNavigationParam } from 'react-navigation-hooks'; | |
| import { graphql, usePreloadedQuery } from 'react-relay/hooks'; | |
| const query = graphql` | |
| query TaskDetailQuery($nodeId: ID!) { | |
| task: node(id: $nodeId) { | |
| ... on Task { | |
| title | |
| } | |
| } |
| #!/bin/sh | |
| # create the file brightnessDown.sh and run | |
| # chmod a+x brightnessDown.sh | |
| ACTUAL=$(xrandr --verbose | grep -i brightness | cut -f2 -d ' ' | head -n1); | |
| echo "$ACTUAL"; | |
| RESULT="$ACTUAL"-0.1; | |
| NEW_VALUE=$(echo "$RESULT" | bc); | |
| RESULT=$(echo "0$NEW_VALUE"); |
Using @defer under an array field will return multiple patches. Patches are unique combinations of label and path
{
items {
id
...frag @defer(label: "my-label")
}
}| import React from 'react'; | |
| import { render, cleanup } from '@testing-library/react'; | |
| import { MockPayloadGenerator } from 'relay-test-utils'; | |
| import { useRelayEnvironment } from 'react-relay/hooks'; | |
| import TransactionList from '../TransactionList'; | |
| afterEach(cleanup); | |
| describe('<TransactionList />', () => { | |
| it('should reject query', () => { |
| import React, { Suspense, useCallback, useState } from 'react'; | |
| import { graphql, useLazyLoadQuery, usePaginationFragment } from 'react-relay/hooks'; | |
| const TransactionsListPagination = (props) => { | |
| const { | |
| data, | |
| loadNext, | |
| isLoadingNext, | |
| hasNext, | |
| refetch, |
| import { useEffect } from 'react'; | |
| import { graphql, readInlineData } from 'react-relay'; | |
| import { useHistory } from '../routing/useHistory'; | |
| import { useAuth_user } from './__generated__/useAuth_user.graphql'; | |
| const useAuthFragment = graphql` | |
| fragment useAuth_user on User @inline { | |
| id |
| import { ROOT_ID } from 'relay-runtime'; | |
| import { useRelayEnvironment } from 'react-relay/hooks'; | |
| import { useLocation, useHistory } from 'react-router-dom'; | |
| import { commitLocalUpdate } from 'react-relay' | |
| import { useMutation } from 'relay-hooks/lib'; | |
| import { AuthUserMutation } from 'mutations/AuthUserMutation'; | |
| export const TOKEN_KEY = 'KEY'; |
| it('should call mutation properly', async () => { | |
| // eslint-disable-next-line | |
| const { debug, getByText, getByTestId } = render(<MyComponent />); | |
| const customMockResolvers = { | |
| ...mockResolvers, | |
| }; | |
| const name = 'myName'; |