Skip to content

Commit

Permalink
auto alias union fields
Browse files Browse the repository at this point in the history
  • Loading branch information
julianbenegas committed Jul 18, 2024
1 parent e284086 commit 4940acc
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 42 deletions.
13 changes: 13 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"mode": "pre",
"tag": "canary",
"initialVersions": {
"eslint-config-custom": "1.0.0",
"tsconfig": "1.0.0",
"basehub": "7.0.6",
"playground": "0.0.113"
},
"changesets": [
"tame-horses-protect"
]
}
5 changes: 5 additions & 0 deletions .changeset/tame-horses-protect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"basehub": patch
---

Auto alias union fields to prevent conflicts
6 changes: 6 additions & 0 deletions packages/basehub/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# basehub

## 7.0.7-canary.0

### Patch Changes

- Auto alias union fields to prevent conflicts

## 7.0.6

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/basehub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "basehub",
"description": "The first AI-native content hub.",
"author": "JB <[email protected]>",
"version": "7.0.6",
"version": "7.0.7-canary.0",
"license": "MIT",
"repository": "basehub-ai/basehub",
"bugs": "https://github.com/basehub-ai/basehub/issues",
Expand Down Expand Up @@ -50,7 +50,7 @@
"react-dom": "^18.2.0"
},
"dependencies": {
"@basehub/genql": "8.0.1",
"@basehub/genql": "9.0.0-canary.0",
"@basehub/mutation-api-helpers": "2.0.0",
"@radix-ui/react-slot": "1.0.2",
"arg": "5.0.1",
Expand Down
7 changes: 7 additions & 0 deletions playground/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# playground

## 0.0.114-canary.0

### Patch Changes

- Updated dependencies
- [email protected]

## 0.0.113

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion playground/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "playground",
"private": true,
"version": "0.0.113",
"version": "0.0.114-canary.0",
"scripts": {
"dev": "basehub dev & next dev",
"build": "basehub && next build",
Expand Down
64 changes: 29 additions & 35 deletions playground/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,42 +1,36 @@
import { Pump } from "basehub/react-pump";
import { BaseHubImage } from "basehub/next-image";
import Image from "next/image";
import { basehub } from "basehub";

export default async function HomePage() {
return (
<Pump
queries={[
{
footer: {
someImage: {
url: true,
width: true,
height: true,
alt: true,
const data = await basehub({ cache: "no-cache" }).query({
unionTests: {
union: {
on_FeaturesBigImageComponent: {
__typename: true,
// __scalar: true,
conflict: true,
},
on_AnotherCompComponent: {
__typename: true,
// __scalar: true,
conflict: true,
nested: {
on_AnotherCompComponent: {
conflict: true,
},
on_FeaturesBigImageComponent: {
conflict: true,
},
},
},
]}
>
{async ([data]) => {
"use server";
return (
<div>
<BaseHubImage
src={data.footer.someImage.url}
alt={data.footer.someImage.alt ?? ""}
width={1600 / 2}
height={900 / 2}
/>
<Image
src={data.footer.someImage.url}
alt={data.footer.someImage.alt ?? ""}
width={1600 / 2}
height={900 / 2}
/>
</div>
);
}}
</Pump>
},
},
});

return (
<div>
<pre>
<code>{JSON.stringify(data, null, 2)}</code>
</pre>
</div>
);
}
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

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

0 comments on commit 4940acc

Please sign in to comment.