-
Notifications
You must be signed in to change notification settings - Fork 26
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
1 parent
a001b47
commit 672061a
Showing
14 changed files
with
132 additions
and
109 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
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 |
---|---|---|
@@ -1,11 +1,16 @@ | ||
import { Partner, ProductVariant } from "~/graphql"; | ||
import { _AsyncData } from 'nuxt/dist/app/composables/asyncData'; | ||
import { H3Error } from 'h3'; | ||
import { Partner, ProductVariant } from '~/graphql'; | ||
|
||
export type ProductVariantQueryResponse = { | ||
export type SalesPersonResponse = _AsyncData< | ||
{ | ||
productVariant: ProductVariant | ||
} | ||
}, | ||
H3Error | ||
>; | ||
|
||
export type LoginMutationResponse = { | ||
export type LoginMutationResponse = { | ||
login: { | ||
partner: Partner | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,23 +1,19 @@ | ||
<script setup lang="ts"> | ||
import { QueryProductVariantArgs, ProductVariantQueryResponse, MutationLoginArgs, LoginMutationResponse } from '~/graphql' | ||
import { QueryProductVariantArgs, ProductVariantQueryResponse, MutationLoginArgs, LoginMutationResponse } from '~/graphql'; | ||
import { QueryName } from '~/server/queries'; | ||
import { MutationName } from '~/server/mutations'; | ||
const { $sdk } = useNuxtApp(); | ||
onMounted(async () => { | ||
const data = await $sdk().odoo.mutation<MutationLoginArgs, LoginMutationResponse>({ mutationName: MutationName.LoginMutation }, { | ||
email: "[email protected]", | ||
password: "123" | ||
}); | ||
// onMounted(async () => { | ||
const data = await $sdk().odoo.query<QueryProductVariantArgs, any>({ queryName: QueryName.GetProductTemplateList }, {}); | ||
console.log(data); | ||
const { data: asa } = await $sdk().odoo.query<QueryProductVariantArgs, ProductVariantQueryResponse>({ queryName: QueryName.LoadUserQuery }, {}); | ||
}) | ||
console.log(data); | ||
const asa = await $sdk().odoo.query<QueryProductVariantArgs, any>({ queryName: QueryName.GetCategories }, {}); | ||
console.log(asa); | ||
// }); | ||
</script> | ||
|
||
|
File renamed without changes.
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,41 @@ | ||
import { partnerFragment } from './fragments'; | ||
import { gql } from '@apollo/client/core'; | ||
|
||
export default gql` | ||
query( | ||
$search: String | ||
$filter: CategoryFilterInput | ||
$currentPage: Int | ||
$pageSize: Int | ||
$sort: CategorySortInput | ||
) { | ||
categories( | ||
search: $search | ||
filter: $filter | ||
currentPage: $currentPage | ||
pageSize: $pageSize | ||
sort: $sort | ||
) { | ||
categories { | ||
id | ||
name | ||
slug | ||
childs { | ||
id | ||
name | ||
slug | ||
childs { | ||
id | ||
name | ||
slug | ||
} | ||
} | ||
parent { | ||
id | ||
name | ||
slug | ||
} | ||
} | ||
} | ||
} | ||
`; |
37 changes: 37 additions & 0 deletions
37
playground-nuxt/app/server/queries/GetProductTemplateList.ts
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,37 @@ | ||
import { gql } from '@apollo/client/core'; | ||
|
||
export default gql` | ||
query( | ||
$filter: ProductFilterInput | ||
$currentPage: Int | ||
$pageSize: Int = 0 | ||
$search: String | ||
$sort: ProductSortInput | ||
) { | ||
products( | ||
filter: $filter | ||
currentPage: $currentPage | ||
pageSize: $pageSize | ||
search: $search | ||
sort: $sort | ||
) { | ||
totalCount | ||
attributeValues { | ||
id | ||
name | ||
displayType | ||
name | ||
htmlColor | ||
search | ||
attribute{ | ||
id | ||
name | ||
} | ||
} | ||
products { | ||
id | ||
} | ||
} | ||
} | ||
`; |
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