https://discord.cloudflare.com logo
Join Discord
Powered by
# durable-objects
  • e

    eidam | SuperSaaS

    04/03/2021, 9:11 PM
    afaik it should not be disabled, it might actually work similarly within Workers (internal worker to worker fetch) in the future
  • k

    Kevin W - Itty

    04/03/2021, 9:22 PM
    so is it safe to assume that embedding routers (e.g. itty) within a DO is expected behavior when you want to expose multiple methods?
  • k

    Kevin W - Itty

    04/03/2021, 9:22 PM
    so is it safe to assume that embedding routers (e.g. itty) within a DO is expected behavior when you want to expose multiple methods?
  • e

    eidam | SuperSaaS

    04/03/2021, 9:23 PM
    thats what I do
  • k

    Kevin W - Itty

    04/03/2021, 9:24 PM
    cool - I mean, it makes sense but feels weird... def wish I could use the Worker as the request handler and once fetched, treat the appropriate DO as a real object...
  • g

    Greg Brimble | Cloudflare Pages

    04/03/2021, 9:25 PM
    I'm embedding a full GraphQL server in each of my DO's 😅
  • k

    Kevin W - Itty

    04/03/2021, 9:25 PM
    lol
  • g

    Greg Brimble | Cloudflare Pages

    04/03/2021, 9:26 PM
    It actually works really well, because you can just stitch them all together from your entrypoint Worker and expose to the internet.
  • g

    Greg Brimble | Cloudflare Pages

    04/03/2021, 9:26 PM
    But probably overkill for most apps.
  • g

    Greg Brimble | Cloudflare Pages

    04/03/2021, 9:27 PM
    (Including my own haha)
  • g

    Greg Brimble | Cloudflare Pages

    04/03/2021, 9:30 PM
    With some smart routing (or GraphQL introspection stuff) you probably could write some sort of object proxy thing.
  • g

    Greg Brimble | Cloudflare Pages

    04/03/2021, 9:30 PM
    Would be really interesting
  • e

    eidam | SuperSaaS

    04/03/2021, 9:30 PM
    I do have API Workers (dev/prod), with binding to the DOs (no dev/prod envs for now), I tend to keep the same route schemas in API and DO, so most of the routes are actually just passing the request to the DO fetch, once its validated/authed or whatever I need to check before.
  • k

    Kevin W - Itty

    04/03/2021, 9:31 PM
    yeah, that is looking like what I was doing as well... Workers stay as a lightweight hand-off to the DO
  • k

    Kevin W - Itty

    04/03/2021, 9:32 PM
    slash gatekeeper
  • l

    lar

    04/04/2021, 12:08 AM
    Have you shared any details on this graphql DO? One of the things I’d love to try with DOs is a graphql gateway/edge cache with persisted queries support.
  • m

    maxastuart

    04/04/2021, 12:11 AM
    I'm curious to see/hear more too, like storage implementation
  • m

    maxastuart

    04/04/2021, 12:12 AM
    Had anyone implemented Data Models in DOs yet?
  • k

    Kevin W - Itty

    04/04/2021, 5:00 AM
    any interest in a utility class to extend that removes all this boilerplate of initialization, persisting, fetch syntax, etc?
  • k

    Kevin W - Itty

    04/04/2021, 5:55 AM
    Example Todos object with the boilerplate removed to DurableObject class... API is embedded in constructor, and
    super.fetch
    checks for
    this.router
    as a shortcut (child
    fetch
    will override if specified). Gets pretty readable, IMO...
  • s

    Sun

    04/04/2021, 6:20 AM
    Does
    wrangler dev
    support DO now ? I tried it with https://github.com/cloudflare/durable-objects-template and got error msg:
    Copy code
    Error: HTTP status client error (400 Bad Request) for url (https://api.cloudflare.com/client/v4/accounts/«account-id»/workers/scripts/«script-name»/edge-preview)
    But when remove class
    Counter
    code, it work and try
    wrangler publish
    also work fine. info: wrangler v1.15.0-custom-builds-rc.2
  • k

    Kevin W - Itty

    04/04/2021, 6:24 AM
    could have sworn i read that they don't (yet)
  • k

    Kevin W - Itty

    04/04/2021, 6:25 AM
  • s

    Sun

    04/04/2021, 6:27 AM
    Thank you for fast replying : )
  • j

    jmshal

    04/04/2021, 9:02 AM
    I just thought I'd jump in here, in case it's glaringly obvious what I'm doing wrong here.... But I'm seeing that my DurableObjectNamespace does not appear on the env object I'm getting to my fetch function export. I've added a KV namespace to test that the env is working properly for everything else, and it's all good.
  • j

    jmshal

    04/04/2021, 9:03 AM
  • j

    jmshal

    04/04/2021, 9:03 AM
  • j

    jmshal

    04/04/2021, 9:04 AM
    env.visionBoards
    isn't defined in the code above.
  • j

    jmshal

    04/04/2021, 9:05 AM
    Any help would be greatly appreciated. I noticed the debugger/quick edit page is broken for DOs - so it's been a little tricky trying to get to the bottom of this 🙂
  • j

    jmshal

    04/04/2021, 9:25 AM
    My current thinking is that maybe I've missed reading somewhere that says that custom routes for DOs are not supported yet - or something. Deploying my worker to workers.dev only, works fine, it appears.
1...424344...567Latest