do TypeGraphQl automatic format the SQL query or not?

72
September 05, 2021, at 03:00 AM

i use typeorm combine with TypeGraphQl. i want to know what the SQL query result provided by TypeGraphQl

for example if i have a User Table with a lot of columns and i have this simple resolver.

@Resolver()
class UserResolver {
  @Query(() => [User])
  async user(): Promise<User[]> {
    return await User.find();
  }
}

and on the client side they request the user data like this

{
  user{
    id,
    name
  }
}

what will the SQL run to the database.

is this one

"SELECT * FROM USER";

or this one

"SELECT id, name FROM USER";

if it the run the first SQL then why i need to use GraphQl in the first place ? isn't rest is better.

or how can i make a dynamic SQL based on the user request ?

Rent Charter Buses Company
READ ALSO
How to get id values from object inner class name?

How to get id values from object inner class name?

I have one page create by javascript and I have these fieldsHow can I navigate and get the inner values just from a class object like this?

114
MariaDB/mysql SQL query question: I want a partial sum of a column based on the group values of another column

MariaDB/mysql SQL query question: I want a partial sum of a column based on the group values of another column

It's difficult (and long) for me to explain what I need, so I'll do with an exampleI have the following table structure:

116
Make Whole Div Clickable in React

Make Whole Div Clickable in React

I have checkbox and its working wellHowever I wanted the whole div to be clickable also not just the checkbox alone

52