Assign same random uuid to every row
So you want to make sure that uuid_generate_v4() is only called once. 

Your solution is essentially doing that. Other solutions only vary in the syntax being used. 

You could use a common table expression to somehow express that in your query: 

with data (id) as (
   select uuid_generate_v4()
)
SELECT *
FROM fruits 
  cross join data;


As the CTE only returns a single row, the cross join won't increase the number of rows in the complete result. Alternatively you could use an "implicit" cross join to make it shorter: 

with data (id) as (
   select uuid_generate_v4()
)
SELECT *
FROM fruits, data;


Or you could remove the CTE and use the function call in a derived table:

SELECT *
FROM fruits, (select uuid_generate_v4() as id);