isographlabs / isograph

The UI framework for teams that move fast — without breaking things.
MIT License
202 stars 9 forks source link

Merging iso/isoFetch syntax #4

Closed edmondop closed 5 months ago

edmondop commented 5 months ago

This change removes from the client library and the compilation isoFetch, in favor of a unified syntax. entrypoint and field are used in the query payload to distinguish the two calls

edmondop commented 5 months ago

If I have an iso`entrypoint Query.field foooooo`, I get the following errors:

Error when compiling.

Unable to parse Isograph literals:

Isograph literals must be immediately called, and passed a function
/Users/rbalicki/code/isograph/demos/github-demo/src/isograph-components/user.tsx

Unparsed tokens remaining
/Users/rbalicki/code/isograph/demos/github-demo/src/isograph-components/user.tsx
entrypoint Query.user_page nooo
                           ^^^^
Compilation took 133ms.

Can you make sure that

    if !has_associated_js_function {
        errors.push(WithLocation::new(
            IsographLiteralParseError::ExpectedAssociatedJsFunction,
            Location::new(text_source, Span::todo_generated()),
        ));
    }

is only called we successfully parsed a ClientFieldDeclaration?

Fixed with 512fa22 (#4)