I need to alter my layout dependin on weather a us...
# orm-help
j
I need to alter my layout dependin on weather a user is logged in or not. Is this a good pattern?
Copy code
const ME = gql`
  query me {
    me {
      id
    }
  }
`;

 <Query query={ME}>
          {({ loading, error, data }) => {
            if (loading) return <Loading />;
            const userisLoggedIn = error ? false : true;

            // Then I use userisLoggedIn to conditionally render stuff
It seems to work but Graphcool BaaS retunred null rather than an error when you queried for a logged in user. For some reason that felt more proper to me.
n
you can also return
null
if you wish so.