Skip to content

Solid start / weired issue !!! #20

@kamalkech

Description

@kamalkech
  • in root.tsx
// @refresh reload
import { Suspense } from "solid-js";
import {
  Body,
  ErrorBoundary,
  FileRoutes,
  Head,
  Html,
  Meta,
  Routes,
  Scripts,
  Title,
} from "solid-start";

// Import components.
import Header from "./components/Header";
// Import style css.
import "./root.css";

import { ApolloProvider, ApolloClient, InMemoryCache } from '@merged/solid-apollo'

const client = new ApolloClient({
  uri: 'https://graphql-demo.mead.io',
  cache: new InMemoryCache(),
})

export default function Root() {
  return (
    <Html lang="en">
      <Head>
        <Title>SolidStart - With TailwindCSS</Title>
        <Meta charset="utf-8" />
        <Meta name="viewport" content="width=device-width, initial-scale=1" />
      </Head>
      <Body>
        <ApolloProvider client={client}>
          <Suspense fallback={<>App is loading…</>}>
            <ErrorBoundary>
              {/* Header */}
              <Header />
              <Routes>
                <FileRoutes />
              </Routes>
            </ErrorBoundary>
          </Suspense>
        </ApolloProvider>
        <Scripts />
      </Body>
    </Html>
  );
}
  • in page file:
import { gql, createQuery } from '@merged/solid-apollo'

const USERS = gql`
  query {
    users {
      id
      name
      posts {
        id
        title
      }
    }
  }
`

export default function Graphql() {
  const data = createQuery(USERS)
  console.log('data', data)
  return <div>Graphql</div>;
}

image

any idea ???

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions