Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graphql with gql.tada #1776

Open
wants to merge 67 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
67 commits
Select commit Hold shift click to select a range
6d303ff
infra: gql.tada initial config
fhenrich33 Nov 24, 2024
71fcfb4
feat: gql.tada implementation WIP
fhenrich33 Nov 24, 2024
d74cdab
refactor: infer types from graphql schema WIP
fhenrich33 Nov 25, 2024
e661590
refactor: infer types from graphql schema WIP
fhenrich33 Nov 25, 2024
5b836f7
chore: remove previous generated types
fhenrich33 Nov 25, 2024
9b79671
chore: remove previous generated types
fhenrich33 Nov 25, 2024
0da0966
refactor: infer types from graphql schema WIP
fhenrich33 Nov 25, 2024
15c5671
refactor: infer types from graphql schema WIP
fhenrich33 Nov 25, 2024
fcaf20c
refactor: infer types from graphql schema WIP
fhenrich33 Nov 25, 2024
672e937
chore: remove previous generated types
fhenrich33 Nov 25, 2024
d29d85c
Merge branch 'master' of https://github.com/boxwise/boxtribute into g…
fhenrich33 Nov 25, 2024
6e9b587
refactor: infer types from graphql schema WIP
fhenrich33 Nov 25, 2024
6006227
infra: fix lock file from merge
fhenrich33 Nov 25, 2024
1a67dd0
refactor: infer types from graphql schema WIP
fhenrich33 Nov 25, 2024
6876ceb
infra: generate and output gql types from single schema file
fhenrich33 Nov 25, 2024
a74dd77
infra: generate and output gql types from single schema file
fhenrich33 Nov 25, 2024
d9b873e
infra: disable field tracking on gql fragments
fhenrich33 Nov 25, 2024
28b5db7
infra: add type checking command to package.json
fhenrich33 Nov 25, 2024
d0c67af
Merge branch 'master' of https://github.com/boxwise/boxtribute into g…
fhenrich33 Nov 26, 2024
134bb7a
infra: update lock file due master merge
fhenrich33 Nov 26, 2024
355103c
refactor: infer types from graphql schema WIP
fhenrich33 Nov 26, 2024
11b2d21
refactor: infer types from graphql schema WIP
fhenrich33 Nov 26, 2024
f7f5317
refactor: infer types from graphql schema WIP
fhenrich33 Nov 26, 2024
21a7592
refactor: infer types from graphql schema WIP
fhenrich33 Nov 26, 2024
9d0c359
refactor: infer types from graphql schema WIP
fhenrich33 Nov 26, 2024
c84256d
refactor: infer types from graphql schema WIP
fhenrich33 Nov 26, 2024
f8df951
refactor: infer types from graphql schema WIP
fhenrich33 Nov 26, 2024
b71e997
refactor: infer types from graphql schema WIP
fhenrich33 Nov 26, 2024
1194b01
refactor: infer types from graphql schema WIP
fhenrich33 Nov 26, 2024
1b21642
fix: comment BE beta level check to fetch test token
fhenrich33 Nov 26, 2024
198c224
Merge branch 'master' of https://github.com/boxwise/boxtribute into g…
fhenrich33 Nov 26, 2024
fdbcdb2
infra: update lock from merge
fhenrich33 Nov 26, 2024
13403e4
refactor: infer types from graphql schema WIP
fhenrich33 Nov 26, 2024
a0feea4
refactor: infer types from graphql schema WIP
fhenrich33 Nov 26, 2024
286cfd8
refactor: infer types from graphql schema WIP
fhenrich33 Nov 26, 2024
176012f
refactor: infer types from graphql schema WIP
fhenrich33 Nov 26, 2024
5bc37c9
chore: remove console.log
fhenrich33 Nov 26, 2024
afb6f92
refactor: infer types from graphql schema WIP
fhenrich33 Nov 26, 2024
4aec1d0
chore: revert BE comment
fhenrich33 Nov 26, 2024
6f32176
Merge branch 'master' of https://github.com/boxwise/boxtribute into g…
fhenrich33 Nov 26, 2024
6fa04fe
refactor: infer types from graphql schema WIP
fhenrich33 Nov 26, 2024
145a7dd
refactor: infer types from graphql schema WIP
fhenrich33 Nov 26, 2024
0d2cdd9
refactor: infer types from graphql schema WIP
fhenrich33 Nov 26, 2024
66812c0
refactor: infer types from graphql schema WIP
fhenrich33 Nov 26, 2024
08e22b2
fix: somehow fixed boxView test...?
fhenrich33 Nov 26, 2024
5c5edbe
fix: infer shipmentDetail type from fragment
fhenrich33 Nov 26, 2024
46470f7
refactor: remove some any types
fhenrich33 Nov 27, 2024
3ce6edb
refactor: infer types from graphql schema
fhenrich33 Nov 27, 2024
4e8c293
refactor: remove some any types
fhenrich33 Nov 27, 2024
4880b89
refactor: move common graphql files to common folder in root project,…
fhenrich33 Nov 27, 2024
448d265
infra: removed unused packages
fhenrich33 Nov 27, 2024
ed32b90
Merge branch 'master' of https://github.com/boxwise/boxtribute into g…
fhenrich33 Nov 27, 2024
6e3b940
chore: add TODO about runnin pnpm graphql-gen in the project root
fhenrich33 Nov 27, 2024
931a945
refactor: dedupe fragments, move to local fragments, queries and types
fhenrich33 Nov 27, 2024
c2f60c3
refactor: dedupe fragments, move to local fragments, queries and types
fhenrich33 Nov 28, 2024
04fd081
refactor: dedupe fragments, move to local fragments, queries and types
fhenrich33 Nov 28, 2024
233fda0
infra: remove --no-frozen-lockfile due removal of potential conflicti…
fhenrich33 Nov 28, 2024
5b1f5c8
docs: add todos for better types, running graphql-gen on BE schema ch…
fhenrich33 Nov 28, 2024
5bef36d
Merge branch 'master' of https://github.com/boxwise/boxtribute into g…
fhenrich33 Nov 28, 2024
26faba2
Update graphql-gen workflow and integrate it with pre-commit
pylipp Nov 28, 2024
e353c3c
Merge branch 'master' of https://github.com/boxwise/boxtribute into g…
fhenrich33 Nov 29, 2024
5398fcd
Merge branch 'master' of https://github.com/boxwise/boxtribute into g…
fhenrich33 Dec 2, 2024
08b642f
Merge branch 'master' of https://github.com/boxwise/boxtribute into g…
fhenrich33 Dec 3, 2024
9c4f505
docs: add docs related to the new graphql setup, suggestions and conv…
fhenrich33 Dec 4, 2024
d326cde
infra: remove unused deps
fhenrich33 Dec 4, 2024
c53b669
Merge branch 'master' of https://github.com/boxwise/boxtribute into g…
fhenrich33 Dec 4, 2024
986a2a0
docs: Update README.md
fhenrich33 Dec 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: infer types from graphql schema WIP
  • Loading branch information
fhenrich33 committed Nov 25, 2024
commit 0da09668ca72c271681bed797335d2edac5a28bd
3 changes: 3 additions & 0 deletions front/src/types/query-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 4,7 @@ import { ALL_SHIPMENTS_QUERY, BOX_QUERY, LOCATIONS_QUERY, USER_QUERY } from "que
import { ALL_TRANSFER_AGREEMENTS_QUERY } from "views/Transfers/TransferAgreementOverview/TransferAgreementOverviewView";
import { introspection_types } from "../../../generated/graphql-env";
import { HISTORY_FIELDS_FRAGMENT, TAG_BASIC_FIELDS_FRAGMENT } from "queries/fragments";
import { PRODUCT_FRAGMENT } from "@boxtribute/shared-components/statviz/queries/fragments";

export type Box = ResultOf<typeof BOX_QUERY>["box"];

Expand All @@ -25,6 26,8 @@ export type Locations = ResultOf<typeof LOCATIONS_QUERY>["locations"];

export type HistoryEntry = ResultOf<typeof HISTORY_FIELDS_FRAGMENT>;

export type Product = ResultOf<typeof PRODUCT_FRAGMENT>;

export type BoxState = introspection_types["BoxState"]["enumValues"];

export type ShipmentState = introspection_types["ShipmentState"]["enumValues"];
Expand Down
2 changes: 1 addition & 1 deletion front/src/views/BaseDashboard/BaseDashboardView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 17,7 @@ export const BASE_DATA = graphql(`
function BaseDashboardView() {
const { baseId } = useBaseIdParam();

const { loading, error, data } = useQuery<BaseDataQuery, BaseDataQueryVariables>(BASE_DATA, {
const { loading, error, data } = useQuery(BASE_DATA, {
variables: {
baseId,
},
Expand Down
24 changes: 12 additions & 12 deletions front/src/views/Distributions/baseData.ts
Original file line number Diff line number Diff line change
@@ -1,25 1,25 @@


export const distroEventStateHumanReadableLabels = new Map<string, string>([
[DistributionEventState.Planning, "Planning"],
["Planning", "Planning"],
// [DistributionEventState.PlanningDone, "Planning Done"],
[DistributionEventState.Packing, "Packing"],
["Packing", "Packing"],
// [DistributionEventState.PackingDone, "Packing Done"],
[DistributionEventState.OnDistro, "On Distribution"],
[DistributionEventState.ReturnedFromDistribution, "Returned From Distribution"],
[DistributionEventState.ReturnTrackingInProgress, "Return Tracking In Progress"],
["OnDistro", "On Distribution"],
["ReturnedFromDistribution", "Returned From Distribution"],
["ReturnTrackingInProgress", "Return Tracking In Progress"],
// [DistributionEventState.ReturnsTracked, "Returned Items Tracked"],
[DistributionEventState.Completed, "Completed"],
["Completed", "Completed"],
]);

export const distroEventStateOrder = [
DistributionEventState.Planning,
"Planning",
// DistributionEventState.PlanningDone,
DistributionEventState.Packing,
"Packing",
// DistributionEventState.PackingDone,
DistributionEventState.OnDistro,
DistributionEventState.ReturnedFromDistribution,
DistributionEventState.ReturnTrackingInProgress,
"OnDistro",
"ReturnedFromDistribution",
"ReturnTrackingInProgress",
// DistributionEventState.ReturnsTracked,
DistributionEventState.Completed,
"Completed",
];
23 changes: 12 additions & 11 deletions shared-components/statviz/components/filter/GenderProductFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,55 4,56 @@ import MultiSelectFilter from "./MultiSelectFilter";
import { IFilterValue } from "./ValueFilter";
import useMultiSelectFilter from "../../hooks/useMultiSelectFilter";
import { IProductFilterValue, productFilterValuesVar } from "../../state/filter";
import { Product } from "../../../../front/src/types/query-types";

export const genders: IFilterValue[] = [
{
value: ProductGender.Boy.valueOf(),
value: "Boy",
label: "Boy",
urlId: "boy",
},
{
value: ProductGender.Girl.valueOf(),
value: "Girl",
label: "Girl",
urlId: "girl",
},
{
value: ProductGender.Men.valueOf(),
value: "Men",
label: "Men",
urlId: "men",
},
{
value: ProductGender.None.valueOf(),
value: "None",
label: "None",
urlId: "none",
},
{
value: ProductGender.TeenBoy.valueOf(),
value: "Teen Boy",
label: "Teen Boy",
urlId: "tb",
},
{
value: ProductGender.TeenGirl.valueOf(),
value: "Teen Girl",
label: "Teen Girl",
urlId: "tg",
},
{
value: ProductGender.UnisexAdult.valueOf(),
value: "UnisexAdult",
label: "UnisexAdult",
urlId: "ua",
},
{
value: ProductGender.UnisexBaby.valueOf(),
value: "Unisex Baby",
label: "Unisex Baby",
urlId: "ub",
},
{
value: ProductGender.UnisexKid.valueOf(),
value: "Unisex Kid",
label: "Unisex Kid",
urlId: "uk",
},
{
value: ProductGender.Women.valueOf(),
value: "Women",
label: "Women",
urlId: "women",
},
Expand All @@ -61,7 62,7 @@ export const genders: IFilterValue[] = [
export const genderFilterId = "gf";
export const productFilterId = "pf";

export const productToFilterValue = (product: ProductDimensionInfo): IProductFilterValue => ({
export const productToFilterValue = (product: Product): IProductFilterValue => ({
id: product.id!,
value: product.id!.toString(),
name: product.name!,
Expand Down