Skip to content

Commit

Permalink
chore: don't generate __typename for graphql (#868)
Browse files Browse the repository at this point in the history
* chore: dont generate __typename for graphql

* fix: change file back
  • Loading branch information
IanKrieger authored Aug 23, 2023
1 parent ee484c1 commit 5019f15
Show file tree
Hide file tree
Showing 14 changed files with 60 additions and 338 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
**/*.generated.tsx
codegen.ts
2 changes: 1 addition & 1 deletion codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const config: CodegenConfig = {
baseTypesPath: "graphql/types.ts",
},
plugins: ["typescript-operations", "typescript-react-apollo"],
config: { withHooks: true, withRefetchFn: true },
config: { withHooks: true, withRefetchFn: true, skipTypename: true },
},
"src/graphql/types.ts": {
plugins: ["typescript"],
Expand Down
39 changes: 1 addition & 38 deletions src/components/EnhancedTable/renderers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@ import {
useUpdateCampaignMutation,
} from "graphql/campaign.generated";
import { AdvertiserCampaignsDocument } from "graphql/advertiser.generated";
import {
useUpdateAdMutation,
useUpdateAdSetMutation,
} from "graphql/ad-set.generated";
import { useUpdateAdSetMutation } from "graphql/ad-set.generated";
import { OnOff } from "../Switch/OnOff";
import { AdDetails } from "user/ads/AdList";
import { displayFromCampaignState } from "util/displayState";
import { AdSetDetails } from "user/adSet/AdSetList";

Expand Down Expand Up @@ -163,36 +159,3 @@ export function adSetOnOffState(c: AdSetDetails): ReactNode {
/>
);
}

export function adOnOffState(c: AdDetails): ReactNode {
const [updateAd, { loading }] = useUpdateAdMutation({
refetchQueries: [
{
query: AdvertiserCampaignsDocument,
variables: { id: c.campaignId },
},
],
});

return (
<OnOff
onChange={(s) => {
{
updateAd({
variables: {
updateAdInput: {
id: c.id,
state: s,
},
},
});
}
}}
loading={loading}
state={c.state}
end={c.campaignEnd}
source={c.campaignSource}
type="Ad"
/>
);
}
114 changes: 13 additions & 101 deletions src/graphql/ad-set.generated.tsx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions src/graphql/ad-set.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,3 @@ mutation updateAdSet($updateAdSetInput: UpdateAdSetInput!) {
...AdSet
}
}

mutation updateAd($updateAdInput: UpdateAdInput!) {
updateCreativeInstanceState(updateAdInput: $updateAdInput) {
id
}
}
Loading

0 comments on commit 5019f15

Please sign in to comment.