forked from prisma-cms/nextjs
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
89,750 additions
and
254,338 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { useRouter } from 'next/dist/client/router' | ||
import { Page } from 'src/pages/_App/interfaces' | ||
|
||
const BeerPage: Page = () => { | ||
const router = useRouter() | ||
|
||
return <>{router.query.id}</> | ||
} | ||
|
||
export default BeerPage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from 'src/pages/Beers' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { NextSeo } from 'next-seo' | ||
|
||
export default () => { | ||
return ( | ||
<> | ||
<NextSeo title="Contacts" description="My contacts" noindex /> | ||
Contacts | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
query beers($where: BeerWhereInput, $first: Int = 3, $skip: Int) { | ||
beersConnection(where: $where, first: $first, skip: $skip) { | ||
aggregate { | ||
count | ||
} | ||
edges { | ||
node { | ||
...beer | ||
} | ||
} | ||
} | ||
} | ||
|
||
fragment beer on Beer { | ||
id | ||
name | ||
uri | ||
places { | ||
id | ||
price | ||
Place { | ||
...place | ||
} | ||
} | ||
} | ||
|
||
fragment place on Place { | ||
id | ||
name | ||
uri | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* eslint-disable */ | ||
|
||
/** | ||
* ФАЙЛ ГЕНЕРИРУЕТСЯ АВТОМАТИЧЕСКИ, ПРАВИТЬ ЕГО НЕ НУЖНО | ||
* Команда для генерирования этого файла: "yarn generate:types" | ||
*/ | ||
|
||
|
||
import * as Types from './types'; | ||
|
||
import { PlaceFragment } from './place'; | ||
import { gql } from '@apollo/client'; | ||
import { PlaceFragmentDoc } from './place'; | ||
export type BeerFragment = { __typename?: 'Beer', id: string, name?: Types.Maybe<string>, uri?: Types.Maybe<string>, places?: Types.Maybe<Array<{ __typename?: 'PlaceBeer', id: string, price?: Types.Maybe<number>, Place: ( | ||
{ __typename?: 'Place' } | ||
& PlaceFragment | ||
) }>> }; | ||
|
||
export const BeerFragmentDoc = gql` | ||
fragment beer on Beer { | ||
id | ||
name | ||
uri | ||
places { | ||
id | ||
price | ||
Place { | ||
...place | ||
} | ||
} | ||
} | ||
${PlaceFragmentDoc}`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* eslint-disable */ | ||
|
||
/** | ||
* ФАЙЛ ГЕНЕРИРУЕТСЯ АВТОМАТИЧЕСКИ, ПРАВИТЬ ЕГО НЕ НУЖНО | ||
* Команда для генерирования этого файла: "yarn generate:types" | ||
*/ | ||
|
||
|
||
import * as Types from './types'; | ||
|
||
import { BeerFragment } from './beer'; | ||
import { gql } from '@apollo/client'; | ||
import { BeerFragmentDoc } from './beer'; | ||
import * as Apollo from '@apollo/client'; | ||
export type BeersQueryVariables = Types.Exact<{ | ||
where?: Types.Maybe<Types.BeerWhereInput>; | ||
first?: Types.Maybe<Types.Scalars['Int']>; | ||
skip?: Types.Maybe<Types.Scalars['Int']>; | ||
}>; | ||
|
||
|
||
export type BeersQuery = { __typename?: 'Query', beersConnection: { __typename?: 'BeerConnection', aggregate: { __typename?: 'AggregateBeer', count: number }, edges: Array<Types.Maybe<{ __typename?: 'BeerEdge', node: ( | ||
{ __typename?: 'Beer' } | ||
& BeerFragment | ||
) }>> } }; | ||
|
||
|
||
export const BeersDocument = gql` | ||
query beers($where: BeerWhereInput, $first: Int = 3, $skip: Int) { | ||
beersConnection(where: $where, first: $first, skip: $skip) { | ||
aggregate { | ||
count | ||
} | ||
edges { | ||
node { | ||
...beer | ||
} | ||
} | ||
} | ||
} | ||
${BeerFragmentDoc}`; | ||
|
||
/** | ||
* __useBeersQuery__ | ||
* | ||
* To run a query within a React component, call `useBeersQuery` and pass it any options that fit your needs. | ||
* When your component renders, `useBeersQuery` returns an object from Apollo Client that contains loading, error, and data properties | ||
* you can use to render your UI. | ||
* | ||
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; | ||
* | ||
* @example | ||
* const { data, loading, error } = useBeersQuery({ | ||
* variables: { | ||
* where: // value for 'where' | ||
* first: // value for 'first' | ||
* skip: // value for 'skip' | ||
* }, | ||
* }); | ||
*/ | ||
export function useBeersQuery(baseOptions?: Apollo.QueryHookOptions<BeersQuery, BeersQueryVariables>) { | ||
return Apollo.useQuery<BeersQuery, BeersQueryVariables>(BeersDocument, baseOptions); | ||
} | ||
export function useBeersLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<BeersQuery, BeersQueryVariables>) { | ||
return Apollo.useLazyQuery<BeersQuery, BeersQueryVariables>(BeersDocument, baseOptions); | ||
} | ||
export type BeersQueryHookResult = ReturnType<typeof useBeersQuery>; | ||
export type BeersLazyQueryHookResult = ReturnType<typeof useBeersLazyQuery>; | ||
export type BeersQueryResult = Apollo.QueryResult<BeersQuery, BeersQueryVariables>; |
Oops, something went wrong.