Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

85
Views
AWS graphql modeling

I have following schema

type Community
  @model
  @auth(rules: [{ allow: owner }, { allow: groups, groups: ["AdminRoot"] }]) {
  id: ID!
  name: String
  users: [User] @manyToMany(relationName: "UserCommunity")
  owner: ID!
  rootAdmin: User @hasOne(fields: ["owner"])
}

type User
  @model
  @auth(
    rules: [
      { allow: owner, ownerField: "id", operations: [read, update] }
      { allow: groups, groups: ["AdminRoot"] }
      { allow: public, provider: apiKey, operations: [create] }
    ]
  ) {
  id: ID!
  name: String
  identityId: String
  communities: [Community] @manyToMany(relationName: "UserCommunity")
}

My problem is when i when i do this query

    query ListCommunities(
      $filter: ModelCommunityFilterInput
      $limit: Int
      $nextToken: String
    ) {
      listCommunities(
        filter: $filter
        limit: $limit
        nextToken: $nextToken
      ) {
        items {
          id
          name
        }
      }
    }

It displays me all the communities where i am the owner.

But i want to display me all the coummunities also the one where i am not the owner but just a User under users

How do i do this? Do i need a lambda? Or with appsync VTL ?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!