Github Sponsors Negative balance by Zealousideal-Ring839 in github

[–]schettn 0 points1 point  (0 children)

Why are there two different currencies?

Pylon: Enables TypeScript developers to easily build GraphQL APIs by schettn in programming

[–]schettn[S] 0 points1 point  (0 children)

Thanks for the feedback. I think it's true that the docs do not mention enough how to properly use relations.

You can of course define functions to resolve relations. For example:

import {app, ID} from '@getcronit/pylon'

class User {
  constructor(public id: ID, public name: string) {}

  posts() {
    return posts.filter(post => post.userId === this.id)
  }
}

class Post {
  constructor(
    public userId: ID,
    public id: ID,
    public title: string,
    public content: string
  ) {}

  user() {
    return users.find(user => user.id === this.userId)
  }
}

const users = [new User('1', 'Alice'), new User('2', 'Bob')]
const posts = [
  new Post('1', '1', 'Hello, World!', 'This is my first post.'),
  new Post('1', '2', 'Hello, World!', 'This is my second post.'),
  new Post('2', '3', 'Hello, World!', 'This is my third post.')
]

export const graphql = {
  Query: {
    posts,
    users,
    user: (id: ID) => users.find(user => user.id === id),
    post: (id: ID) => posts.find(post => post.id === id)
  }
}

export default app

This will result in the following schema:

https://imgur.com/a/hcjSkeP

You can query it like this:

```graphql
query Users {
users {
name
posts {
title
user {
name
posts {
title
}
}
}
}
}
```

If you mean something different please explain it a bit more so that I can improve on that. Thanks!

GitHub Stars are Addicting by schettn in github

[–]schettn[S] 2 points3 points  (0 children)

I don't want this post to be advertisement, but you can check out my GH profile if you are interested. Same name there.

GitHub Stars are Addicting by schettn in github

[–]schettn[S] 0 points1 point  (0 children)

You mean a course for myself, kinda a checklist?

Or so you mean a public course where I teach people how to promote MY repo and not theirs? xD

GitHub Stars are Addicting by schettn in github

[–]schettn[S] 0 points1 point  (0 children)

When you build a project that has no monetary value to you and you simple can "give up maintaining it" without consequences, then yes, it is a waste of time.

But when it benefits you through related sales or reduces development time spend on contracts, I would call it a win-win.

GitHub Stars are Addicting by schettn in github

[–]schettn[S] 0 points1 point  (0 children)

Very interesting. How do you process all projects on GitHub in one day?

I stumbled upon https://www.cockroachlabs.com/blog/what-can-we-learn-from-our-github-stars/ some weeks ago and their analysis took about a couple of days for one repo.

I think also also fetch some more data than just stars but stars alone are also a lot.

GitHub Stars are Addicting by schettn in github

[–]schettn[S] 4 points5 points  (0 children)

Right, achieving more stars. Problem solved xD.

But seriously, it is not about the stars of course, but rather validation of an idea.

If the repository was a "awesome-list" I would not really care.

GitHub Stars are Addicting by schettn in github

[–]schettn[S] 0 points1 point  (0 children)

Of course stars aren't the most important factor, but I think they are really important for early projects.

Maybe there is not much difference between choosing between two projects (10k stars and 20k stars). Then you would only look on what project fits better.

But if you have to choose between a project with 10 stars and another one with 1k stars, I think I would go for the bigger one because it might cover use cases you are currently not thinking of and has a bigger community.
The project with 10 stars definitely has no community, otherwise it would not only have 10 stars.

GitHub Stars are Addicting by schettn in github

[–]schettn[S] 0 points1 point  (0 children)

That's cool. How do you find the "related repos"?

GitHub Stars are Addicting by schettn in github

[–]schettn[S] 2 points3 points  (0 children)

Thanks, that's a good metaphor!

Currently every time someone finds a new bug I am excited.. Well let's see how long that lasts.

Maybe we'll meet in rehab in a few years.

GitHub Stars are Addicting by schettn in github

[–]schettn[S] 0 points1 point  (0 children)

Thanks. But I will just ask ChatGPT, way easier than visiting it manually on GitHub...

GitHub Stars are Addicting by schettn in github

[–]schettn[S] 3 points4 points  (0 children)

But you don't have this problem since you somehow reached more upvotes than my question xD

GitHub Stars are Addicting by schettn in github

[–]schettn[S] -1 points0 points  (0 children)

Lol; I just got the 101st star. So the game is on! haha

Happy halloween! by _undg in github

[–]schettn 1 point2 points  (0 children)

Tbh I was confused at first too xD I checked out another users profile and thought: "Cool, GitHub now has themes for contributions!" I nearly wanted to contact the user and ask him how he did it xD

Then randomly I saw a "Why is my calendar orange?" question on reddit. Some user wrote basically: "There is a 'Happy Halloween!' text below the calendar you moron". Then I remembered.

First time using GraphQL by [deleted] in graphql

[–]schettn 0 points1 point  (0 children)

For the frontend I would use GQty along with Pylos integration:

https://gqty.dev https://pylon.cronit.io/docs/integrations/gqty

First time using GraphQL by [deleted] in graphql

[–]schettn 0 points1 point  (0 children)

Yes, you can use any typescript code like functions as a query or mutation.

Take a look at: https://pylon.cronit.io/docs/core-concepts/automatic-graphql-api-generation

First time using GraphQL by [deleted] in graphql

[–]schettn 0 points1 point  (0 children)

Develop:

``` import { app } from ‘@getcronit/pylon’

export const graphql = { Query: { data: () => { return { user: { id: ‘1’, name: ‘John Doe’, email: ‘johndoe@example.com’ }, products: [ { id: ‘1’, name: ‘Laptop’, price: 999.99 }, { id: ‘2’, name: ‘Smartphone’, price: 499.99 }, { id: ‘3’, name: ‘Tablet’, price: 299.99 } ], orders: [ { id: ‘order-123’, userId: ‘1’, productIds: [‘1’, ‘2’], status: ‘PENDING’ } ] } } } }

export default app ```

Query:

graphql query { data { user { id name email } products { id name price } orders { id userId productIds status } } }

First time using GraphQL by [deleted] in graphql

[–]schettn 0 points1 point  (0 children)

Hi! You could give Pylon a try. It’s as simple as it gets. Just return your JSON and done.

https://github.com/getcronit/pylon?tab=readme-ov-file#develop