Git Product home page Git Product logo

Comments (4)

cinnamon-bun avatar cinnamon-bun commented on August 25, 2024

Yeah, this is awkward. I think the IStorage query functions should accept an array of queries which would work in the same way as sync queries:

workspace.documents([
    {pathPrefix: "/about/"},
    {pathPrefix: "/wiki/"},
])

It would also still accept a single query object, or no query at all:

documents(q?: Query | Query[]) => Document[]

Matching against one query object, a document has to match EVERY property in the query. E.g. every property in a query object narrows down the search.

Overall, it would return documents that match ANY of the queries in the array. E.g. each additional query in the array broadens the search.

Would you be open to changing the GraphQL query to work this way instead of having arrays within one query object? I think this combination of narrowing and broadening will allow us to express complex queries.

from earthstar.

cinnamon-bun avatar cinnamon-bun commented on August 25, 2024

See also #47 (More comprehensive query options) for ideas about revamping query objects

from earthstar.

sgwilym avatar sgwilym commented on August 25, 2024

@cinnamon-bun I like this, and I'm definitely opening to changing how filters work in earthstar-graphql. Sure it's a little more complex, but I'm not too worried as GraphQL will be able to help people understand how to make valid filters.

from earthstar.

cinnamon-bun avatar cinnamon-bun commented on August 25, 2024

I've gotten stuck: what to do with the limit field? It makes sense to limit each query inside its own object, but what if you want an overall limit?

Maybe you just can't do that.

from earthstar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.