Skip to content

Commit

Permalink
Companies query with order by coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
Fi1osof committed Mar 12, 2021
1 parent 6d884d2 commit fc743d6
Show file tree
Hide file tree
Showing 11 changed files with 486 additions and 249 deletions.
1 change: 0 additions & 1 deletion .storybook/preview.tsx
Expand Up @@ -63,7 +63,6 @@ addDecorator(makeDecorator({
events: {} as MittEmitter,
isReady: true,
isLocaleDomain: false,
isPreview: false,
}}
>
{storyFn(context)}
Expand Down
2 changes: 1 addition & 1 deletion server/nexus/constants.ts
Expand Up @@ -2,7 +2,7 @@
* ID ТВшек
*/
export const TemplateVarIDs = {
coors: 27,
coords: 27,
image: 3,
gallery: 23,
address: 14,
Expand Down
13 changes: 10 additions & 3 deletions server/nexus/generated/nexus.ts
Expand Up @@ -70,6 +70,15 @@ export interface NexusGenInputs {
equals?: boolean | null // Boolean
not?: NexusGenInputs['NestedBoolFilter'] | null // NestedBoolFilter
}
CompaniesOrderByCoordsInput: {
// input type
lat: number // Float!
lng: number // Float!
}
CompaniesOrderByInput: {
// input type
coords?: NexusGenInputs['CompaniesOrderByCoordsInput'] | null // CompaniesOrderByCoordsInput
}
DateTimeFilter: {
// input type
equals?: NexusGenScalars['DateTime'] | null // DateTime
Expand Down Expand Up @@ -1313,11 +1322,9 @@ export interface NexusGenArgTypes {
}
companies: {
// args
cursor?: NexusGenInputs['bani684_site_contentWhereUniqueInput'] | null // bani684_site_contentWhereUniqueInput
orderBy?: NexusGenInputs['bani684_site_contentOrderByInput'][] | null // [bani684_site_contentOrderByInput!]
orderBy?: NexusGenInputs['CompaniesOrderByInput'] | null // CompaniesOrderByInput
skip?: number | null // Int
take?: number | null // Int
where?: NexusGenInputs['bani684_site_contentWhereInput'] | null // bani684_site_contentWhereInput
}
ratings: {
// args
Expand Down
20 changes: 13 additions & 7 deletions server/nexus/generated/schema.graphql
Expand Up @@ -81,6 +81,18 @@ type Comment {
text: String
}

"""
Сортировка по удаленности от координаты
"""
input CompaniesOrderByCoordsInput {
lat: Float!
lng: Float!
}

input CompaniesOrderByInput {
coords: CompaniesOrderByCoordsInput
}

"""
Компания
"""
Expand Down Expand Up @@ -332,13 +344,7 @@ type Query {
"""
Компании
"""
companies(
cursor: bani684_site_contentWhereUniqueInput
orderBy: [bani684_site_contentOrderByInput!]
skip: Int
take: Int
where: bani684_site_contentWhereInput
): [Company!]!
companies(orderBy: CompaniesOrderByInput, skip: Int, take: Int): [Company!]!

"""
Рейтинги заведений
Expand Down

0 comments on commit fc743d6

Please sign in to comment.