Interesting. I am looking at the logs for my postg...
# orm-help
a
Interesting. I am looking at the logs for my postgres container and I find the same SQL query being run for two different graphql queries. These are the SQL queries:
Copy code
2018-07-03 09:10:47.389 UTC [58] LOG:  execute <unnamed>: SELECT * FROM "default$default"."Department" AS "Alias" WHERE TRUE ORDER BY  "Alias"."id"  asc
2018-07-03 09:10:54.081 UTC [58] LOG:  execute <unnamed>: SELECT * FROM "default$default"."Department" AS "Alias" WHERE TRUE ORDER BY  "Alias"."id"  asc
These are the GraphQL queries:
Copy code
query {
  departments {
    description
    name
  }
}

query {
  departments {
    name
  }
}
Shouldn't these queries be selective about what fields are queried in the database instead of just doing a wildcard on both? Maybe there is some kind of lower threshold (say less than 3 cols in the table) where prisma just does wildcard?
n
Thanks for bringing this up @Arnab, currently Prisma fetches all fields for any query. We should add this to the documentation 🙂 I also added a feature request it optimize this behaviour: https://github.com/prismagraphql/prisma/issues/2727
a
👏 love the quick response!