Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions apps/events/src/components/events/events.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import {
preparePublish,
publishOps,
useCreateEntity,
useEntities,
useHypergraphApp,
useQuery,
useSpaces,
} from '@graphprotocol/hypergraph-react';
import { useState } from 'react';
Expand All @@ -14,7 +14,7 @@ import { Input } from '../ui/input';
import { Label } from '../ui/label';

export const Events = () => {
const { data: eventsLocalData } = useQuery(Event, { mode: 'private' });
const { data: eventsLocalData } = useEntities(Event, { mode: 'private' });
const createEvent = useCreateEntity(Event);
const { getSmartSessionClient } = useHypergraphApp();
const { data: spaces } = useSpaces({ mode: 'public' });
Expand Down
4 changes: 2 additions & 2 deletions apps/events/src/components/playground.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { _useDeleteEntityPublic, useHypergraphApp, useQuery, useSpace } from '@graphprotocol/hypergraph-react';
import { _useDeleteEntityPublic, useEntities, useHypergraphApp, useSpace } from '@graphprotocol/hypergraph-react';
import { useState } from 'react';
import { Event } from '../schema';
import { Button } from './ui/button';

export const Playground = ({ spaceId }: { spaceId: string }) => {
const { data, isLoading, isError, invalidEntities } = useQuery(Event, {
const { data, isLoading, isError, invalidEntities } = useEntities(Event, {
mode: 'public',
include: {
sponsors: {
Expand Down
4 changes: 2 additions & 2 deletions apps/events/src/components/projects.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useQuery } from '@graphprotocol/hypergraph-react';
import { useEntities } from '@graphprotocol/hypergraph-react';
import { Project } from '../schema';

export const Projects = ({ spaceId }: { spaceId: string }) => {
const { data, isLoading, isError } = useQuery(Project, {
const { data, isLoading, isError } = useEntities(Project, {
mode: 'public',
// include: {
// sponsors: {
Expand Down
4 changes: 2 additions & 2 deletions apps/events/src/components/todo/todos-local.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useHardDeleteEntity, useQuery, useUpdateEntity } from '@graphprotocol/hypergraph-react';
import { useEntities, useHardDeleteEntity, useUpdateEntity } from '@graphprotocol/hypergraph-react';
import { Todo2 } from '../../schema';
import { Button } from '../ui/button';

export const TodosLocal = () => {
const updateEntity = useUpdateEntity(Todo2);
const hardDeleteEntity = useHardDeleteEntity();
const { data: todosLocalData, deleted: deletedTodosLocalData } = useQuery(Todo2, { mode: 'private' });
const { data: todosLocalData, deleted: deletedTodosLocalData } = useEntities(Todo2, { mode: 'private' });

return (
<>
Expand Down
10 changes: 8 additions & 2 deletions apps/events/src/components/todo/todos-public.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { _generateDeleteOps, publishOps, useHypergraphApp, useQuery, useSpace } from '@graphprotocol/hypergraph-react';
import {
_generateDeleteOps,
publishOps,
useEntities,
useHypergraphApp,
useSpace,
} from '@graphprotocol/hypergraph-react';
import { Todo2 } from '../../schema';
import { Spinner } from '../spinner';
import { Button } from '../ui/button';
Expand All @@ -10,7 +16,7 @@ export const TodosPublic = () => {
data: dataPublic,
isLoading: isLoadingPublic,
isError: isErrorPublic,
} = useQuery(Todo2, {
} = useEntities(Todo2, {
mode: 'public',
include: { assignees: {} },
});
Expand Down
6 changes: 3 additions & 3 deletions apps/events/src/components/todos-read-only-filter.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useQuery } from '@graphprotocol/hypergraph-react';
import { useEntities } from '@graphprotocol/hypergraph-react';
import { Todo } from '../schema';

export const TodosReadOnlyFilter = () => {
const { data: todosCompleted } = useQuery(Todo, { mode: 'private', filter: { completed: { is: true } } });
const { data: todosNotCompleted } = useQuery(Todo, {
const { data: todosCompleted } = useEntities(Todo, { mode: 'private', filter: { completed: { is: true } } });
const { data: todosNotCompleted } = useEntities(Todo, {
mode: 'private',
filter: { completed: { is: false } },
});
Expand Down
4 changes: 2 additions & 2 deletions apps/events/src/components/todos-read-only.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useQuery } from '@graphprotocol/hypergraph-react';
import { useEntities } from '@graphprotocol/hypergraph-react';
import { Todo } from '../schema';

export const TodosReadOnly = () => {
const { data: todos } = useQuery(Todo, { mode: 'private' });
const { data: todos } = useEntities(Todo, { mode: 'private' });

return (
<>
Expand Down
6 changes: 3 additions & 3 deletions apps/events/src/components/todos.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
useCreateEntity,
useDeleteEntity,
useQuery,
useEntities,
useRemoveRelation,
useSpace,
useUpdateEntity,
Expand All @@ -13,12 +13,12 @@ import { Button } from './ui/button';
import { Input } from './ui/input';

export const Todos = () => {
const { data: todos } = useQuery(Todo, {
const { data: todos } = useEntities(Todo, {
mode: 'private',
include: { assignees: {} },
// filter: { or: [{ name: { startsWith: 'aa' } }, { name: { is: 'sdasd' } }] },
});
const { data: users } = useQuery(User, { mode: 'private' });
const { data: users } = useEntities(User, { mode: 'private' });
const { ready: spaceReady } = useSpace({ mode: 'private' });
const createEntity = useCreateEntity(Todo);
const updateEntity = useUpdateEntity(Todo);
Expand Down
12 changes: 9 additions & 3 deletions apps/events/src/components/todos2.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { useCreateEntity, useDeleteEntity, useQuery, useSpace, useUpdateEntity } from '@graphprotocol/hypergraph-react';
import {
useCreateEntity,
useDeleteEntity,
useEntities,
useSpace,
useUpdateEntity,
} from '@graphprotocol/hypergraph-react';
import { useEffect, useState } from 'react';
import Select from 'react-select';
import { cn } from '@/lib/utils';
Expand All @@ -15,13 +21,13 @@ export const Todos2 = () => {
isLoading: isLoadingTodos,
isError: isErrorTodos,
// preparePublish: preparePublishTodos,
} = useQuery(Todo2, { mode: 'private', include: { assignees: {} } });
} = useEntities(Todo2, { mode: 'private', include: { assignees: {} } });
const {
data: dataUsers,
isLoading: isLoadingUsers,
isError: isErrorUsers,
// preparePublish: preparePublishUsers,
} = useQuery(User, { mode: 'private' });
} = useEntities(User, { mode: 'private' });
const { ready: spaceReady } = useSpace({ mode: 'private' });
const createTodo = useCreateEntity(Todo2);
const updateTodo = useUpdateEntity(Todo2);
Expand Down
4 changes: 2 additions & 2 deletions apps/events/src/components/users.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { useCreateEntity, useQuery, useSpace } from '@graphprotocol/hypergraph-react';
import { useCreateEntity, useEntities, useSpace } from '@graphprotocol/hypergraph-react';
import { useState } from 'react';
import { User } from '../schema.js';
import { Button } from './ui/button.js';
import { Input } from './ui/input.js';
import { UserEntry } from './user-entry.js';

export const Users = () => {
const { data: users } = useQuery(User, { mode: 'private' });
const { data: users } = useEntities(User, { mode: 'private' });
const { ready: spaceReady } = useSpace({ mode: 'private' });
const createEntityNew = useCreateEntity(User);
const [newUserName, setNewUserName] = useState('');
Expand Down
4 changes: 2 additions & 2 deletions apps/events/src/components/users/users-local.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useHardDeleteEntity, useQuery } from '@graphprotocol/hypergraph-react';
import { useEntities, useHardDeleteEntity } from '@graphprotocol/hypergraph-react';
import { User } from '../../schema';
import { Button } from '../ui/button';

export const UsersLocal = () => {
const hardDeleteEntity = useHardDeleteEntity();
const { data: usersLocalData, deleted: deletedUsersLocalData } = useQuery(User, { mode: 'private' });
const { data: usersLocalData, deleted: deletedUsersLocalData } = useEntities(User, { mode: 'private' });

return (
<>
Expand Down
4 changes: 2 additions & 2 deletions apps/events/src/components/users/users-merged.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useDeleteEntity, useQuery } from '@graphprotocol/hypergraph-react';
import { useDeleteEntity, useEntities } from '@graphprotocol/hypergraph-react';
import { User } from '../../schema';
import { Spinner } from '../spinner';
import { Button } from '../ui/button';

export const UsersMerged = () => {
const { data, isLoading, isError } = useQuery(User, { mode: 'private' });
const { data, isLoading, isError } = useEntities(User, { mode: 'private' });
const deleteEntity = useDeleteEntity();

return (
Expand Down
14 changes: 12 additions & 2 deletions apps/events/src/components/users/users-public.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
import { _generateDeleteOps, publishOps, useHypergraphApp, useQuery, useSpace } from '@graphprotocol/hypergraph-react';
import {
_generateDeleteOps,
publishOps,
useEntities,
useHypergraphApp,
useSpace,
} from '@graphprotocol/hypergraph-react';
import { User } from '../../schema';
import { Spinner } from '../spinner';
import { Button } from '../ui/button';

export const UsersPublic = () => {
const { id: spaceId } = useSpace({ mode: 'public' });
const { data: dataPublic, isLoading: isLoadingPublic, isError: isErrorPublic } = useQuery(User, { mode: 'public' });
const {
data: dataPublic,
isLoading: isLoadingPublic,
isError: isErrorPublic,
} = useEntities(User, { mode: 'public' });
const { getSmartSessionClient } = useHypergraphApp();
return (
<>
Expand Down
4 changes: 2 additions & 2 deletions apps/privy-login-example/src/components/events/events.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import {
preparePublish,
publishOps,
useCreateEntity,
useEntities,
useHypergraphApp,
useQuery,
useSpaces,
} from '@graphprotocol/hypergraph-react';
import { useState } from 'react';
Expand All @@ -14,7 +14,7 @@ import { Input } from '../ui/input';
import { Label } from '../ui/label';

export const Events = () => {
const { data: eventsLocalData } = useQuery(Event, { mode: 'private' });
const { data: eventsLocalData } = useEntities(Event, { mode: 'private' });
const createEvent = useCreateEntity(Event);
const { getSmartSessionClient } = useHypergraphApp();
const { data: spaces } = useSpaces({ mode: 'public' });
Expand Down
4 changes: 2 additions & 2 deletions apps/privy-login-example/src/components/playground.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { _useDeleteEntityPublic, useHypergraphApp, useQuery, useSpace } from '@graphprotocol/hypergraph-react';
import { _useDeleteEntityPublic, useEntities, useHypergraphApp, useSpace } from '@graphprotocol/hypergraph-react';
import { useState } from 'react';
import { Event } from '../schema';
import { Button } from './ui/button';

export const Playground = ({ spaceId }: { spaceId: string }) => {
const { data, isLoading, isError } = useQuery(Event, {
const { data, isLoading, isError } = useEntities(Event, {
mode: 'public',
include: {
sponsors: {
Expand Down
4 changes: 2 additions & 2 deletions apps/privy-login-example/src/components/todo/todos-local.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useHardDeleteEntity, useQuery, useUpdateEntity } from '@graphprotocol/hypergraph-react';
import { useEntities, useHardDeleteEntity, useUpdateEntity } from '@graphprotocol/hypergraph-react';
import { Todo2 } from '../../schema';
import { Button } from '../ui/button';

export const TodosLocal = () => {
const updateEntity = useUpdateEntity(Todo2);
const hardDeleteEntity = useHardDeleteEntity();
const { data: todosLocalData, deleted: deletedTodosLocalData } = useQuery(Todo2, { mode: 'private' });
const { data: todosLocalData, deleted: deletedTodosLocalData } = useEntities(Todo2, { mode: 'private' });

return (
<>
Expand Down
10 changes: 8 additions & 2 deletions apps/privy-login-example/src/components/todo/todos-public.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { _generateDeleteOps, publishOps, useHypergraphApp, useQuery, useSpace } from '@graphprotocol/hypergraph-react';
import {
_generateDeleteOps,
publishOps,
useEntities,
useHypergraphApp,
useSpace,
} from '@graphprotocol/hypergraph-react';
import { Todo2 } from '../../schema';
import { Spinner } from '../spinner';
import { Button } from '../ui/button';
Expand All @@ -10,7 +16,7 @@ export const TodosPublic = () => {
data: dataPublic,
isLoading: isLoadingPublic,
isError: isErrorPublic,
} = useQuery(Todo2, {
} = useEntities(Todo2, {
mode: 'public',
include: { assignees: {} },
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useQuery } from '@graphprotocol/hypergraph-react';
import { useEntities } from '@graphprotocol/hypergraph-react';
import { Todo } from '../schema';

export const TodosReadOnlyFilter = () => {
const { data: todosCompleted } = useQuery(Todo, { mode: 'private', filter: { completed: { is: true } } });
const { data: todosNotCompleted } = useQuery(Todo, {
const { data: todosCompleted } = useEntities(Todo, { mode: 'private', filter: { completed: { is: true } } });
const { data: todosNotCompleted } = useEntities(Todo, {
mode: 'private',
filter: { completed: { is: false } },
});
Expand Down
4 changes: 2 additions & 2 deletions apps/privy-login-example/src/components/todos-read-only.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useQuery } from '@graphprotocol/hypergraph-react';
import { useEntities } from '@graphprotocol/hypergraph-react';
import { Todo } from '../schema';

export const TodosReadOnly = () => {
const { data: todos } = useQuery(Todo, { mode: 'private' });
const { data: todos } = useEntities(Todo, { mode: 'private' });

return (
<>
Expand Down
6 changes: 3 additions & 3 deletions apps/privy-login-example/src/components/todos.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
useCreateEntity,
useDeleteEntity,
useQuery,
useEntities,
useRemoveRelation,
useSpace,
useUpdateEntity,
Expand All @@ -13,12 +13,12 @@ import { Button } from './ui/button';
import { Input } from './ui/input';

export const Todos = () => {
const { data: todos } = useQuery(Todo, {
const { data: todos } = useEntities(Todo, {
mode: 'private',
include: { assignees: {} },
// filter: { or: [{ name: { startsWith: 'aa' } }, { name: { is: 'sdasd' } }] },
});
const { data: users } = useQuery(User, { mode: 'private' });
const { data: users } = useEntities(User, { mode: 'private' });
const { ready: spaceReady } = useSpace({ mode: 'private' });
const createEntity = useCreateEntity(Todo);
const updateEntity = useUpdateEntity(Todo);
Expand Down
12 changes: 9 additions & 3 deletions apps/privy-login-example/src/components/todos2.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { useCreateEntity, useDeleteEntity, useQuery, useSpace, useUpdateEntity } from '@graphprotocol/hypergraph-react';
import {
useCreateEntity,
useDeleteEntity,
useEntities,
useSpace,
useUpdateEntity,
} from '@graphprotocol/hypergraph-react';
import { useEffect, useState } from 'react';
import Select from 'react-select';
import { cn } from '@/lib/utils';
Expand All @@ -15,13 +21,13 @@ export const Todos2 = () => {
isLoading: isLoadingTodos,
isError: isErrorTodos,
// preparePublish: preparePublishTodos,
} = useQuery(Todo2, { mode: 'private', include: { assignees: {} } });
} = useEntities(Todo2, { mode: 'private', include: { assignees: {} } });
const {
data: dataUsers,
isLoading: isLoadingUsers,
isError: isErrorUsers,
// preparePublish: preparePublishUsers,
} = useQuery(User, { mode: 'private' });
} = useEntities(User, { mode: 'private' });
const { ready: spaceReady } = useSpace({ mode: 'private' });
const createTodo = useCreateEntity(Todo2);
const updateTodo = useUpdateEntity(Todo2);
Expand Down
4 changes: 2 additions & 2 deletions apps/privy-login-example/src/components/users.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { useCreateEntity, useQuery, useSpace } from '@graphprotocol/hypergraph-react';
import { useCreateEntity, useEntities, useSpace } from '@graphprotocol/hypergraph-react';
import { useState } from 'react';
import { User } from '../schema.js';
import { Button } from './ui/button.js';
import { Input } from './ui/input.js';
import { UserEntry } from './user-entry.js';

export const Users = () => {
const { data: users } = useQuery(User, { mode: 'private' });
const { data: users } = useEntities(User, { mode: 'private' });
const { ready: spaceReady } = useSpace({ mode: 'private' });
const createEntity = useCreateEntity(User);
const [newUserName, setNewUserName] = useState('');
Expand Down
4 changes: 2 additions & 2 deletions apps/privy-login-example/src/components/users/users-local.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useHardDeleteEntity, useQuery } from '@graphprotocol/hypergraph-react';
import { useEntities, useHardDeleteEntity } from '@graphprotocol/hypergraph-react';
import { User } from '../../schema';
import { Button } from '../ui/button';

export const UsersLocal = () => {
const hardDeleteEntity = useHardDeleteEntity();
const { data: usersLocalData, deleted: deletedUsersLocalData } = useQuery(User, { mode: 'private' });
const { data: usersLocalData, deleted: deletedUsersLocalData } = useEntities(User, { mode: 'private' });

return (
<>
Expand Down
Loading
Loading