Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[epic] Replace schema with pico #469

Open
rbalicki2 opened this issue Mar 10, 2025 · 0 comments
Open

[epic] Replace schema with pico #469

rbalicki2 opened this issue Mar 10, 2025 · 0 comments
Assignees
Labels

Comments

@rbalicki2
Copy link
Collaborator

rbalicki2 commented Mar 10, 2025

We have functions that mutate the schema. That is fundamentally incompatible with pico, which requires that functions are pure. Well, mutating parameters isn't that!

So, instead, in the DB we should basically store all the fields that we are currently using the schema for.

Consider generating a reader AST from

field Query.Foo {
  bar {
    baz
  }
}

We would have the following call tree:

  • get_parsed_iso_literal(someIdentifier)
  • get_type("Query") -> query_object_id
    • parse_graphql_schema
      • schema file input
  • get_field(query_object_id, "Foo") -> ensure there are no collisions? Idk tbh
    • parse_graphql_schema
      • schema file input
  • get_field(query_object_id, "bar") -> bar_object_id, ensure it's an object etc
    • parse_graphql_schema
      • schema file input
  • get_field(bar_object_id, "baz") -> ensure it's a scalar

Key takeaways:

  • at no point do we validate everything, ideally including in the "parse_graphql_schema" step, e.g. we can proceed, even if there's another iso literal in a bad state
  • there is no schema, just free functions
  • it may also mean that selection sets are not stored on the client field/pointer, and fields are not stored on schema objects
@rbalicki2 rbalicki2 self-assigned this Mar 10, 2025
@rbalicki2 rbalicki2 added the pico label Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant